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:
opts ?. containingElement ?. scrollIntoView ?.( { block : 'center' , inline : 'center' } ) ;
Not sure about the root cause but originalTop and newTop 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
open https://codesandbox.io/p/sandbox/happy-elion-hqrj27?file=%2Fpackage.json
resize window so that the combobox dropdown would be scrollable.
open the combobox dropdown and navigate with keyboard to the last item.
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
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
originalTopandnewTopare 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