How to render option labels differently when focused? #6085
Unanswered
ericmorand
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently using react-select in its unstyled form, and I can't figure how to render the focused option labels that are displayed in the menu - typically when the end-user uses the keyboard to navigate through the option.
I know about the
formatOptionLabelmethod that is expected to return a node, but it does not receive the focused state of the option; and I know about theclassNames.optionmethod that receives the focused state but is only expected to return a class name; last, I know about thestyles.optionmethod, but it is expected to return some style values which is a violation of the separation of concern - i.e. the style is controlled by the application instead of the stylesheet.What I need is a way to render an option label depending on the focused state.
Can anybody help me find the proper way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions