[material-ui][Select] Select not propagating readonly
attribute to input
#42256
Labels
bug 🐛
Something doesn't work
component: select
This is the name of the generic UI component, not the React module!
component: text field
This is the name of the generic UI component, not the React module!
good first issue
Great for first contributions. Enable to learn the contribution process.
package: material-ui
Specific to @mui/material
Steps to reproduce
Link to live example: (required)
https://stackblitz.com/edit/react-n9koip-itsgyz?file=index.html,Demo.tsx
Steps:
Current behavior
Ref SelectInput
https://github.com/mui/material-ui/blob/dc922eeec5c1870affd9dfa3c6a351786a2ba451/packages/mui-material/src/Select/SelectInput.js
onMouseDown={disabled || readOnly ? null : handleMouseDown}
but the Input element without "readonly" attribute
(please check the imaged below, you cannot find readonly from input element of selectTextfield)
so in live demo page, the dropdown list didn't show color:lightgray
Expected behavior
the behavior should be aligned with the attribute "disabled" or the "readonly" attribute in TextField
Ref SelectInput
https://github.com/mui/material-ui/blob/dc922eeec5c1870affd9dfa3c6a351786a2ba451/packages/mui-material/src/Select/SelectInput.js (line.523-536)
I expected there to be an attribute "readonly={readonly}" like disabled={disabled}, so the readonly can apply to the Input element in the end.
Context
Your environment
Browsers:
Chrome: 124.0.6367.201
Search keywords: TextField
Search keywords:
The text was updated successfully, but these errors were encountered: