-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] slotProps.htmlInput.component does not replace input html element #44580
Comments
@balazs-zsoldos use Paste below code here for working demo
component prop is not supported in htmlInput. I believe the reason TypeScript doesn't throw a type error is that, currently, InputBaseComponentProps accepts any string. current: material-ui/packages/mui-material/src/InputBase/InputBase.d.ts Lines 245 to 250 in e720f3b
Updating the InputBaseComponentProps type as shown below will cause TypeScript to throw an error when the component prop is passed to htmlInput. cc @DiegoAndai @ZeeshanTamboli wdyt, should i make this change? Post change:
|
Hey, @balazs-zsoldos, thanks for the report. As @sai6855 explained, this is expected as the HTML input element does not accept a @sai6855 I wouldn't change this type at this moment. |
@DiegoAndai @sai6855 Thanks for the clarification. All clear now. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @balazs-zsoldos How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
The following works and replaces the wrapper div of the input element:
The following does not work:
Current behavior
Does not replace the element in the rendered component.
Expected behavior
Replaces the <input element in the rendered component.
Context
I would like to put a link instead of the html element in the component, so I can keep other e.g.: shrinked label, so the link will fit with the other fields in the form.
Your environment
npx @mui/envinfo
Search keywords: htmlinput
The text was updated successfully, but these errors were encountered: