I am using react-select in my project for the select elements.
I wonder if there is a way to check on keydown event in the select (can be both the select input or on the menu) if the menu is open or closed.
I am using react select version ^2.4.2, and have to support explorer.
P.S: for whoever is not familiar with the react-select library: it doesnt create typical HTML 'select' and 'option' elements, but rather a text input and on each click (or some dedicated keydown events (accessibility)) on the input/menu - it toggles a div with the options.
Thank you!
found the answer for it - I am using the built in onMenuClose and onMenuOpen props to toggle a custom attribute (e.g. 'is-open') value between true/false on the input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With