-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Combobox closes when navigating items with keyboard (May release regression) #8298
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
Comments
Some more finding: Previously, |
Thanks for the issue and doing a bit of the investigation. It is very much appreciated and helps a lot. It does seem like it has to do with the order that We originally added the requestAnimationFrame because of an issue with the selected item not scrolling into view in Picker but seems like that introduced this bug unfortunately. I've experimented a bit with adding a raf around I wasn't able to reproduce this in our storybooks with and without scrolling on. I can within the docs if I resize the screen small enough so that the popover is scrollable. |
Thanks for the quick fix. Is there a chance you of having this released in a patch version (in selection, select and combobox packages at least) before the next minor release? |
Provide a general summary of the issue here
It's a regression caused by the May release. Navigating past the last visible item scrolls the window closing the dropdown.
react-spectrum-combobox-bug.mov
🤔 Expected Behavior?
It should be possible to navigate listbox items.
😯 Current Behavior
The page scrolls unnecessarily, moving the combobox and closing the dropdown.
💁 Possible Solution
Not sure why, but this line is causing the window to scroll:
react-spectrum/packages/@react-aria/utils/src/scrollIntoView.ts
Line 114 in 0784c3d
Not sure about the root cause but
originalTop
andnewTop
are not equal after the May release.🔦 Context
It happened in our library that's built on top of react aria, and the same issue was reproducible in react-spectrum too.
🖥️ Steps to Reproduce
Version
3.42.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: