[Select] backgroundColor not forwarded to element
See original GitHub issueDescribe the bug
When trying to forward backgroundColor
to Select
, it does not work as expected.
Expected Behavior I would expect the color to change.
To Reproduce
<Select backgroundColor="blue">
<option>Test</option>
</Select>
** Suggested solution(s)** Workaround
const StyledSelect = styled(Select)`
background-color: blue;
`;
I was able to get it to work by overriding the component, but I’m guessing the prop is just not getting passed to correctly. It looks like it was trying to put backgroundColor
on the DOM.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
jquery - Selecting elements with a certain background color
if i understand the question correctly, the selector [attribute=value] will not work because <span> does not contain an attribute "background-color". you ...
Read more >CSS background-color not honored in disabled SELECT ...
Issue 100234: CSS background-color not honored in disabled SELECT element ... Create a SELECT element and set it's background-color to "red".
Read more >HTML DOM Style backgroundColor Property - W3Schools
The backgroundColor property sets or returns the background color of an element. ... inherit, Inherits this property from its parent element.
Read more >Overriding The Default Text Selection Color With CSS
One of those cool CSS3 declarations that you can use today is ::selection, which overrides your browser-level or system-level text highlight ...
Read more >Change a message background - Microsoft Support
Give messages a professional look when you change the default white background. Whether you select a different background color or go for more...
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
@aaronmcadam. The Select is still the native select component, not the
SingleSelect
we discussed in #140.I intend to release a patch for this issue so users can style any part of the Select.
I noticed I didn’t add it to the docs. I will do so shortly.
I’ll release an update soon.