You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interact with the react-select component using the keyboard:
Press the arrow down key twice to highlight the second option (“Battery Powered Tools”).
Press the space or enter key to select the second option.
Observe that the focus moves back to the first element (“Top Picks”) again. This behavior repeats every time any other element is selected or deselected.
When using the mouse to select an option other than the first (“Top Picks”), the first option “steals” the hover effect until the mouse is slightly moved to reset the hover effect to the correct element.
If you don’t set the state in the handleComboboxChange function, the focus remains on the selected element, and the arrow keys work as expected.
Note:
This issue does not occur when running the component in CodeSandbox, but it does occur in Create React App (CRA) and Vite (tested in two separate freshly initialized projects).
Many thanks in advance!
The text was updated successfully, but these errors were encountered:
Reproduction Repository:
https://github.com/SetupCoding/react-select-test-vite
Steps to Reproduce:
npm install
.npm run dev
.localhost:5173
.Video of Reproduction
Keyboard interaction:
https://github.com/user-attachments/assets/839b1b83-de61-4889-bbe0-53303d6cfcbb
Mouse interaction:
https://github.com/user-attachments/assets/9142d7ad-d4a6-4745-9f4d-844ef7f6cc56
Additional Observations:
Note:
Many thanks in advance!
The text was updated successfully, but these errors were encountered: