Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing shift + tab selects highlighted item #1604

Open
vongb opened this issue May 17, 2024 · 0 comments
Open

Pressing shift + tab selects highlighted item #1604

vongb opened this issue May 17, 2024 · 0 comments

Comments

@vongb
Copy link

vongb commented May 17, 2024

  • downshift version: 9.0.6
  • node version: v18.20.1
  • npm (or yarn) version: 1.22.19

What you did:

  1. Open the dropdown
  2. Make sure there is a highlighted item
  3. Press Shift + Tab
  4. Dropdown closes (expected)
  5. Highlighted item selected (unexpected)

This can be reproduced in the useMultipleSelection with combobox example in downshift-js.com

What happened:

Reproduction repository:

Problem description:
If I understand correctly, the highlighted item should not be selected when Shift + Tab is pressed, it should just navigate to the previous element in the tab index. I think it's selecting it because of this code here. When we shift tab to a previous element, that bit will be false which will tell the reducer to select an item.

Suggested solution:
I'm thinking we can just rely just on checking if the active element is the document body. (Not sure if I'm missing another use case here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant