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
Support extra material ui options for fields #1647
Comments
We started using react-jsonschema-form with Material UI recently and we also noticed that extra properties supported by default in Material UI. Specifically in our case we needed the "className" property. Also I could not find a working example of how to have the same setup as on https://cybertec-postgresql.github.io/rjsf-material-ui/ because in our case passing |
@epicfaace thanks for tagging this. what do you think about my suggestion on the solution? If you think we should take a different approach here - let me know and I can think of some other options. |
I found a way to do this by overriding the TextFieldWidget locally with one that passes in the |
@dekelb thanks for noting this issue. I'm good with your suggestion, but just wondering about the semantics of it. I'm wondering whether to define custom options for each setting in |
@epicfaace @dekelb I'd suggest that any solution also allows passing props to Template components. For instance, I'd like to pass props to an ArrayFieldTemplate to control, for example, the label width, or whether to use a vertical or horizontal layout a row of fields, etc. This comment is related. |
This would be really helpful for our project as well |
@dekelb , are there any updates/consensus on this? |
Any updates on this. Seems PR is done for a fix to issue but hasn't yet been merged. |
Material-UI's form fields support more UI configurations, but those config settings are not exported to the user with the current widgets.
For example - if you look at the current implementation of the RangeWidget you can see the following:
MateriaUI's Slider component support also properties, such as marks/scale/orientation/valueLabelDisplay and others.
This is just an example for the Slider widget, but other widgets will probably have other properties that we would like to support.
There are multiple ways to solve this, I think it's best to do this from the
uiSchema
(since it's not related to the schema itself).My suggestion is to have
ui:props
in theuiSchema
of the field, and pass these values to the field itself.I'm happy to open a PR for this, in case it makes sense.
The text was updated successfully, but these errors were encountered: