Skip to content
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

[MUI5] Extra props passed to DOM #1119

Open
wight554 opened this issue May 30, 2022 · 4 comments
Open

[MUI5] Extra props passed to DOM #1119

wight554 opened this issue May 30, 2022 · 4 comments
Assignees
Labels
Area: Theme Affects some of the theme packages Theme: Material-UI Affects the uniforms-material package Theme: MUI Affects the uniforms-mui package Type: Bug Bug reports and their fixes
Milestone

Comments

@wight554
Copy link

wight554 commented May 30, 2022

Version:

{
    "uniforms": "^3.10.0-rc.0",
    "uniforms-bridge-json-schema": "^3.10.0-rc.0",
    "uniforms-mui": "^3.10.0-rc.0",
}

Errors I've managed to catch (more to be added):

SelectField:

Warning: React does not recognize the `InputLabelProps` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `inputlabelprops` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
<ScenarioSelectField
  allowedValues={['A', 'B', 'C']}
  name="field"
  size="small"
  InputLabelProps={{ shrink: true }}
/>
@wight554
Copy link
Author

wight554 commented May 30, 2022

Unsure about this one. Trying to replicate it in smaller form. It only happens on submit when num field is in form:

Warning: Received `true` for a non-boolean attribute `decimal`.

If you want to write it to the DOM, pass a string instead: decimal="true" or decimal={value.toString()}.

Edit: it's somehow related to ErrorField, reproduction snippet:

const schema = {
  title: 'Test',
  type: 'object',
  properties: {
    num: { title: 'Num', type: 'number', minimum: 0, maximum: 100 },
  },
  required: ['num'],
};

const schemaValidator = createValidator(schema);

export const bridge = new JSONSchemaBridge(schema, schemaValidator);

<AutoForm schema={bridge}>
  <AutoField name="num" />
  <ErrorField name="num" />
  <SubmitField />
</AutoForm>

Edit2:
I assume it's due to

// uniforms-mui/src/ErrorField.tsx

<FormHelperText {...filterDOMProps(props)}>
  {children || errorMessage}
</FormHelperText>

@wight554
Copy link
Author

@radekmie at this point that's all I've faced. Might help debugging other possible props

@wight554 wight554 changed the title Extra props passed to DOM [TBD] [MUI5] Extra props passed to DOM May 30, 2022
@wadamek65
Copy link
Contributor

@wight554 Thanks for the issue report. Did you by any chance check if the same behavior exists for the uniforms-material theme too?

@wadamek65 wadamek65 added the Type: Bug Bug reports and their fixes label May 31, 2022
@wight554
Copy link
Author

wight554 commented May 31, 2022

@wight554 Thanks for the issue report. Did you by any chance check if the same behavior exists for the uniforms-material theme too?

99% sure it does. I've used unofficial MUI5 theme which was based on material-ui + codemod and it had same issues
Edit: link

@radekmie radekmie added this to the v3.10 milestone Jun 6, 2022
@radekmie radekmie added Area: Theme Affects some of the theme packages Theme: Material-UI Affects the uniforms-material package Theme: MUI Affects the uniforms-mui package labels Jun 10, 2022
@radekmie radekmie modified the milestones: v3.10, v4.0 Oct 7, 2022
@radekmie radekmie moved this to To do in Open Source Nov 18, 2022
@piotrpospiech piotrpospiech modified the milestones: v4.0, v4.x Apr 12, 2024
@kestarumper kestarumper moved this from To do to On Hold in Open Source Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Theme Affects some of the theme packages Theme: Material-UI Affects the uniforms-material package Theme: MUI Affects the uniforms-mui package Type: Bug Bug reports and their fixes
Projects
Status: On Hold
Development

No branches or pull requests

4 participants