Getting `opacity: 0` on input after select value
See original GitHub issueBasically, after selecting a value from the react-select v2 dropdown (basic dropdown 1-1 with single-option html select
; e.g., no creating options, no multi-options, etc), the value in the input box disappears because something in react-select v2 is setting the input
element itself to opacity: 0
.
This only happens for me when the value was non-empty-string when the component first rendered.
I noticed that in the case where a different react-select input but with the same config had an empty-string input value at first render, the issue does not exist.
I worked around simply with an !important
css directive to override what react-select v2 is doing.
Sorry, I do not have a reproduction available at this point to share.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:23
- Comments:12
Top Results From Across the Web
Change opacity for select element if option is selected
Now I need to change the opacity to 0.5 for every select element which has a selected option after the page has loaded....
Read more >react-select option opacity - CodeSandbox
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >Input and select fields not returning to original opacity - SitePoint
The last value is a level of opacity from zero to one. In the rule above I have set the black (0,0,0) to...
Read more >opacity - CSS: Cascading Style Sheets - MDN Web Docs
The opacity CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and...
Read more >HTML DOM Style opacity Property - W3Schools
The opacity-level of an element describes the transparency-level, where 1 is not transperant at all, 0.5 is 50% see-through, and 0 is completely...
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
If using the new styles API, you can do something like this in the
styles
prop:Yeah, @jakehong0521. If you do it that way, you’re only applying the styles to the containing
div
, not to theinput
element itself. Adding theinput: {}
object in the styles works because it creates a nested selector that targets the actualinput
element.