Skip to content

fix: prevent combobox from closing when navigating through items with keyboard #8301

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

Merged
merged 4 commits into from
May 27, 2025

Conversation

yihuiliao
Copy link
Member

@yihuiliao yihuiliao commented May 23, 2025

Closes #8298

Seems like the order that scrollIntoView and scrolIntoViewport matters so wrap it all in a raf

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

I can't seem to actually reproduce in our storybook but I can within our docs.

  1. Go to V3 Combobox docs
  2. Using the first example, resize the screen so that the popover is scrollable. Ensure that there is enough space below so that the popover will open on the bottom and not the top
  3. Open the popover using the keyboard, and navigate throw the items using the down arrow
  4. The popover should not close when you move past the last visible item

Would be good to test to make sure that V3 Picker still scroll into view with this change. You can test with the "long item text" story

🧢 Your Project:

@rspbot
Copy link

rspbot commented May 23, 2025

@rspbot
Copy link

rspbot commented May 23, 2025

@yihuiliao yihuiliao changed the title wip: Combobox scroll regression fix: prevent combobox from closing when navigating through items with keyboard May 27, 2025
@rspbot
Copy link

rspbot commented May 27, 2025

@yihuiliao yihuiliao marked this pull request as ready for review May 27, 2025 17:37
Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LFDanLu LFDanLu added this pull request to the merge queue May 27, 2025
Merged via the queue into main with commit 79505ba May 27, 2025
32 checks passed
@LFDanLu LFDanLu deleted the combobox-scroll-regression branch May 27, 2025 17:54
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

Successfully merging this pull request may close these issues.

Combobox closes when navigating items with keyboard (May release regression)
4 participants