[Select] - First options receives .Mui-focusVisible always
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
There is some issue with :focus-visible
for Select. For the first time when there is no value selected .Mui-focusVisible
class is getting applied to the first item in a list. This is not the case for the Menu component though. Also, this happens only in Chrome.
Expected Behavior 🤔
Same behaviour as the Menu component has.
Steps to Reproduce 🕹
Two components side by side:https://codesandbox.io/s/material-ui-issue-forked-udm04?file=/src/Demo.js
Steps:
Case 1:
- Open Select via mouse click
- The first item is highlighted with a red border meaning the
focusVisible
class was added
Case 2:
- Refresh a page
- Open Menu via mouse click everything works as expected
Context 🔦
Want have focus applied on Select only when it was focused with a keyboard. The options should also stay without focus if the keyboard wasn’t used
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v5.0.0.alpha.17 |
React | 17 |
Browser | Chrome |
TypeScript | |
etc. |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
[Select] - First options receives .Mui-focusVisible always #23747
Open Menu via mouse click everything works as expected. Context. Want have focus applied on Select only when it was focused with a...
Read more >How to avoid Material UI Select focus when option is chosen?
So if your problem is the focus after the value selection, try this: 1) Import MuiThemeProvider and createMuiTheme on your component:
Read more >How to set the default value for an HTML <select> element
The default value of the select element can be set by using the 'selected' attribute on the required option. This is a boolean...
Read more >Form Select | Components - BootstrapVue
Generate your select options by passing an array or object to the options props: ... text: 'This is First option' }, { value:...
Read more >How do I get the text value of a selected option?
Select elements typically have two values that you want to access. First there's the value to be sent to the server, which is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still a problem btw. Anyway to fix this?
I also encountered the same event. I think the environment is the same as @orest22. Are there any plans to fix this?