UISchema classNames do not work with material-ui theme
See original GitHub issuePrerequisites
- 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
UISchema classNames
do not seem to work with the material-ui
theme.
Steps to Reproduce
See this simple sample: JSONSchema
{
"properties": {
"field": {
"type": "string"
}
}
}
UISchema
{
"classNames": "extraClass"
}
See the playgrounds
Expected behavior
extraClass
like in the default
html output:
<form class="rjsf">
<div class="form-group field field-undefined extraClass">
<fieldset id="root">
<div class="form-group field field-string">
<label class="control-label" for="root">
field
</label>
<input class="form-control" id="root" label="field" placeholder="" type="text" value="">
</div>
</fieldset>
</div>
<div>
<button type="submit" class="btn btn-info">
Submit
</button>
</div>
</form>
Actual behavior
No extraClass
in the material-ui
html output:
<form class="rjsf">
<div class="MuiFormControl-root MuiFormControl-fullWidth">
<div class="MuiGrid-root jss5 MuiGrid-container MuiGrid-spacing-xs-2">
<div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12" style="margin-bottom: 10px;">
<div class="MuiFormControl-root MuiFormControl-fullWidth">
<div class="MuiFormControl-root MuiFormControl-fullWidth">
<div class="MuiFormControl-root MuiTextField-root">
<label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated" data-shrink="false" for="root" id="root-label">
field
</label>
<div class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl">
<input aria-invalid="false" id="root" name="" type="string" class="MuiInputBase-input MuiInput-input" value="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<button type="submit" class="btn btn-info">
Submit
</button>
</div>
</form>
A simple code search shows no result for classnames
in the path /packages/material-ui/src/
.
Version
The current github pages version.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Themes - react-jsonschema-form documentation
Using themes To use a theme from a package, just import the <Form /> component from that package. For example, to use the...
Read more >How to use react-jsonschema-form with material-ui?
A: Probably not. We use Bootstrap v3 and it works fine for our needs. We would like for react-jsonschema-form to support other frameworks,...
Read more >react-jsonschema-materialui-forms - npm
Note: The CDN version does not embed react or react-dom . ... The uiSchema object accepts a classNames property for each field of...
Read more >Fixing Material UI's ClassName Mismatch for React
React Application; @material-ui/core of version of at least 4.9 (I'm not sure if this will work for older versions but it doesn't hurt...
Read more >material-ui-schema-form - npm package | Snyk
Learn more about material-ui-schema-form: package health score, popularity, ... and its maintainers don't seem to have an upgrade anywhere on their roadmap.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If providing field level classNames is not yet supported for material UI, is there a work around until support is avaialble?
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.