rjsf-team/react-jsonschema-form
在 GitHub 查看Feature Request: Ability to conditionally show non-required fields
Open
#2,164 建立於 2020年12月10日
corefeaturehelp wanted
描述
Prerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I'm providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
In a schema with many required and optional fields, it would be handy to be able to conditionally only show required fields, especially if few users ever need them.
<Form
requiredOnly={true}
Even better would be the ability to filter fields using an arbitrary function, for example:
<Form
filter={field => field.isRequired && field.description.includes("test")}
But that might be going overboard. Thanks for considering!