[Autocomplete] can't change option highlight color
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 😯
The Autocomplete component uses a very light default option highlight and doesn’t exposes any CSS props to easily change it as far as i can tell.
Expected Behavior 🤔
an easy css classname/selector exposed to change the highlight color of the options
currently, it’s setting .MuiAutocomplete-option[data-focus="true"]
but I can’t figure out how to actually change that using makeStyles or any other documented way
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:20 (6 by maintainers)
Top Results From Across the Web
[Autocomplete] can't change option highlight color #19692
The Autocomplete component uses a very light default option highlight and doesn't exposes any CSS props to easily change it as far as...
Read more >Change the color of MUI Autocomplete option - Stack Overflow
I have to render option by option with the respective color in option background.
Read more >Change highlight color Autocomplete Material UI ReactJS
This post explains how to change highlight color for Autocomplete Material UI in ReactJS.
Read more >A trick to change the autocomplete background-color
What we've done here is simply select the pseudo element Autofill and then apply a huge box shadow inside of it, so the...
Read more >MUI v5 -> How to style options inside Autocomplete component
I'm just trying to change the background color on hover, and based on whether or not it is selected. I've tried 2 approaches...
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
I’m able to change it by doing:
Actually, I found a solution that will work for now. I just needed to do:
and then in my component function, simply call
useStyles();
It’s not great, but it will get me through until a “real” solution is found.
Thanks!