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

[material-ui][TextField] Props passed in inputProps are not attached when slotProps.htmlInput is passed #44320

Open
sai6855 opened this issue Nov 4, 2024 · 0 comments
Assignees
Labels
component: text field This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@sai6855
Copy link
Contributor

sai6855 commented Nov 4, 2024

Steps to reproduce

Link to live example: (required) https://stackblitz.com/edit/react-osybga?file=Demo.tsx

Steps:

  1. className is passed in inputProps and id is passed through slotProps.htmlInput
  2. On inspecting you can notice, className passed in inputProps didn't get attached and only id got attached
  3. Since inputProps is deprecated not removed, as a user i would expect old behavior would work as is, irrespective of whether slotProps is passed or not.

FYI: This PR actually solved this issue, we can consider merging it if we think this issue is a bug.

How to test changes changes are working in #43606

  1. open https://deploy-preview-43606--material-ui.netlify.app/material-ui/react-text-field/#basic-textfield demo
  2. paste code from above live example (I'm not able to create a sandbox from PR)
  3. Notice in html that both className and id got attached to input

Current behavior

props passed in inputProps not getting attached if slotProps.htmlInput is passed

Expected behavior

props passed in inputProps should get attched

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: TextField

@sai6855 sai6855 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 4, 2024
@zannager zannager added the component: text field This is the name of the generic UI component, not the React module! label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants