[TextField] When TextField is used as select, onChange handler type should be ChangeEvent<HTMLSelectElement>
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
When using a TextField as select (using the select prop), the onChange handler expects a function that receives a ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
Expected behavior 🤔
It should accept a ChangeEvent<HTMLSelectElement>
Steps to reproduce 🕹
Context 🔦
This is a minor issue with no real problematic consequences, the workaround is simple, use a ChangeEvent<HTMLInputElement>.
Your environment 🌎
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the TextField component's select prop and inspect how its onChange handler type is declared for select usage. Use the linked TypeScript reproduction to confirm the current error; done means a select TextField accepts ChangeEvent without the workaround described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100