material-ui
material-ui copied to clipboard
MuiTextField inputProps for "form" will disable onSubmit handler.
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Steps to reproduce 🕹
Steps:
- set default props for MuiTextField in the theme with the following props...
MuiTextField: { defaultProps: { inputProps: { autoComplete: 'new-password', form: { type: 'submit', autoComplete: 'off', }, }, autoComplete: 'off', size: 'small', margin: 'dense', variant: 'outlined', fullWidth: true, }, },
Current behavior 😯
Form will lose the onSubmit() event on Enter
Expected behavior 🤔
I expected to be able to submit my form after I hit enter.
Context 🔦
No response
Your environment 🌎
"react": "^18.2.0", "@mui/material": "^5.9.3",
It doesn't look like this bug report has enough info for one of us to reproduce it.
Please provide a CodeSandbox (https://mui.com/r/issue-template), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.