Skip to content

How to get rid of --is-focused, when the menu is closed? #5981

Closed Answered by M4XPRD
M4XPRD asked this question in Q&A
Discussion options

You must be logged in to vote

Here's the solution I've found, if someone would ever need it:

const selectRef = useRef<SelectInstance<EventSelectOption> | null>(null) 

/*
 EventSelectionOptions include 'value' and 'label'
 and, in my case, 'title', 'days', 'month', which are used in `formatOptionLabel`
*/

  return (
    <Controller
      name={name}
      control={control}
      render={({ field }) => (
        <Select
          {...field}
          ref={selectRef} <---- Place ref into Select
          placeholder={'Choose a meeting'}
          options={eventsOptions}
          value={selectedValue}
          className={styles.select}
          classNamePrefix={'select'}
          onChange={(selectedOption) => {
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by M4XPRD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant