-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow replacing hard coded fields & widgets through the registry #310
Comments
I have an implementation for this in my personal fork. I could create a pull request if approved. (I have also suggested #205 and mentioned that I could implement it, but I'd personally give this one higher priority.) |
+1 to this. I though this was something that should be really easy to implement (not only for widgets but also for fields), much more taking into account how amazing and configurable the library is ... so please let us know if your request is accepted ! |
Closed by #371 |
I'd like to change every checkbox to some switch component. To achieve this, I'd have to provide a custom SchemaField to the form, which would be identical to the default SchemaField with the addition, that I'd have to import StringField from a custom StringField. That StringField would be identical the default StringField with the addition, that I'd have to import BooleanField from a custom BooleanField. That BooleanField would be identical to the default BooleanField with the addition, that I'd have to import CheckboxWidget from a custom CheckboxWidget. And finally, I could replace the checkbox with a switch component.
The other option would be to create a custom widget, and point every checkbox in uiSchema to use that custom component. But that wouldn't be a global solution.
What if I could just give the Form a custom CheckboxWidget in Form's
widgets
-property, and BooleanField would import the CheckboxWidget from the registry? It would be way simpler and I could drop like 1000 lines of copy pasted code.SchemaField, DescriptionField and TitleField can already be overridden through the registry. Maybe we should allow overriding every field/widget and always import from the registry?
tl;dr All hard coded field/widget components should import field/widget components from the registry. All fields/widgets should be possible to override through Form's
widgets
andfields
properties.The text was updated successfully, but these errors were encountered: