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

scrollIntoViewport: improve scrolling behavior for elements with multiple scrollable parents #6187

Merged
merged 6 commits into from
Apr 19, 2024

Conversation

reidbarber
Copy link
Member

@reidbarber reidbarber commented Apr 11, 2024

Closes #5696

✅ 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:

In the new story, open the menu and keyboard navigate all the way down to invoke scrolling. The focused key should stay in view as you keep navigating down.

I've added this same example to a stackblitz without this fix, so you can see the original issue. We didn't have any stories that made this easy to reproduce without making your window height very small.

🧢 Your Project:

RSP

@rspbot
Copy link

rspbot commented Apr 11, 2024

@adobe adobe deleted a comment from rspbot Apr 11, 2024
@reidbarber reidbarber changed the title scrollIntoViewport: improve scrolling behavior for elements with multiple scrollable parents WIP: scrollIntoViewport: improve scrolling behavior for elements with multiple scrollable parents Apr 11, 2024
@reidbarber reidbarber changed the title WIP: scrollIntoViewport: improve scrolling behavior for elements with multiple scrollable parents scrollIntoViewport: improve scrolling behavior for elements with multiple scrollable parents Apr 12, 2024
@rspbot
Copy link

rspbot commented Apr 18, 2024

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

Tested with a variety of components (menu w/ sections, virtualized/non virtualized lists, tabs, calendar, etc) and things seems be scrolled into view properly.

@rspbot
Copy link

rspbot commented Apr 19, 2024

@rspbot
Copy link

rspbot commented Apr 19, 2024

@rspbot
Copy link

rspbot commented Apr 19, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@react-aria/utils

useFormReset

-
+getScrollParents {
+  node: Element
+  checkForOverflow?: boolean
+  returnVal: undefined
+}

@snowystinger snowystinger merged commit 81162ea into main Apr 19, 2024
25 checks passed
@snowystinger snowystinger deleted the fix-scrollIntoViewport branch April 19, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MENU]Issue in navigating to menu items using arrow keys when items are rendered in a menu section
5 participants