material-ui: [TextField][material-ui] id is missing in select TextField's input element
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Steps to reproduce ๐น
Link to live example:
https://stackblitz.com/edit/stackblitz-starters-bzhhl2?file=src%2FApp.tsx
Steps:
- Create a TextField component with the
selectproperty as true
Current behavior ๐ฏ
<input> element is missing the id used in the <label>'s for attribute.
Expected behavior ๐ค
id is present in the <input>.
Context ๐ฆ
No response
Your environment ๐
No response
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 2
- Comments: 25 (15 by maintainers)
@mj12albert Yes, Iโll start working on it.
InputLabelProps={{ htmlFor: 'element-id' }} inputProps={{ id: 'element-id }}I donโt know the history of it. It seems weird for the
labelto reference adivin itsforattribute. I suppose we could generate an id of the input and associate it with the label. I would not remove or change the id on the div itself, though.