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
UISchema classNames do not work with material-ui theme #1738
Comments
Related to #1647 |
If providing field level classNames is not yet supported for material UI, is there a work around until support is avaialble? |
Maybe not a real workaround, but what about a wrapper around the schema with a separate schema set with only the display none fields. and then with submit, submitting the wrapped json? |
Any updates on this? |
I met the same problem when using material ui, and as a workaround, I put className into formContext props and make it out. https://react-jsonschema-form.readthedocs.io/en/latest/api-reference/form-props/#formcontext |
Hi, can you give us some examples about solving field style problems with formContext? |
I've been poking around debugging and inside SchemaField.js, there is this section:
With that, If uiSchema is passed along without modification, then something like this can be done in the themes TextWidget.tsx class:
At that point, the classNames passed into uiSchema would be attached to the element the theme creates - in this case Once you can pass classes in - you can use the normal useStyles/makeStyles paradigm:
I'd be willing to make a PR with these changes if I'm understanding everything correctly here. |
Has anyone investigated or solved the problem? |
Wow it's crazy such an important problem is still there for that long time! I'm gonna open a PR about it, I mean, it's the basic of such a theme library, to at least support the basic features of the form generator itself. |
Fixed in 5.x |
Prerequisites
Description
UISchema
classNames
do not seem to work with thematerial-ui
theme.Steps to Reproduce
See this simple sample:
JSONSchema
UISchema
See the playgrounds
Expected behavior
extraClass
like in thedefault
html output:Actual behavior
No
extraClass
in thematerial-ui
html output:A simple code search shows no result for
classnames
in the path/packages/material-ui/src/
.Version
The current github pages version.
The text was updated successfully, but these errors were encountered: