Skip to content

wip: enable keyboard scrolling in S2 Popover when content overflows#10091

Draft
yihuiliao wants to merge 3 commits into
mainfrom
scroll-popover
Draft

wip: enable keyboard scrolling in S2 Popover when content overflows#10091
yihuiliao wants to merge 3 commits into
mainfrom
scroll-popover

Conversation

@yihuiliao
Copy link
Copy Markdown
Member

@yihuiliao yihuiliao commented May 20, 2026

Closes #5303

The original issue was for V3 but the same issue occurred in S2. We focus the Popover but it wasn't a scrollable region (only the inner div was), so if you hit any of the up/down arrow keys, the content wouldn't scroll. The only way to scroll content via keyboard was if there was a focusable item inside. We move overflow: 'auto to the Popover so it is both focused + a scrollable region.

My only concern is that this could potentially affect a lot of other components which rely on Popover. I've tested other components but might have missed something

Btw, I still need to run chromatic so this PR is not quite done yet...

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

Test ComboBox, Menu, Picker, Popover in storybook when the content scrolls. Make sure styles haven't changed, no double scrollbars, scroll into view works

Compare S2 Storybook > Popover > Help Center. Previously, if the content scrolled and you pressed the down arrow key, nothing would happen. You would first need to tab into the region. Now, you should be able to press the down arrow key and the content should scroll.

🧢 Your Project:

default: 'elevated',
isArrowShown: 'none'
},
outlineStyle: 'solid',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Image

I'm not sure if there was reason we were using outline over borders. However, since overflow: auto was moved to the popover and not inner div, the outline was appearing on top of the scrollbar. Using border ensures that it appears underneath.

*ignore the squished image, i didn't want it take up too much space but you can see where the outline is

@rspbot
Copy link
Copy Markdown

rspbot commented May 20, 2026

@rspbot
Copy link
Copy Markdown

rspbot commented May 20, 2026

@rspbot
Copy link
Copy Markdown

rspbot commented May 20, 2026

Agent Skills Changes

Modified (48)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/58b074e4fd732c3975d1b49b23f878c6cfeaf1a8/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/58b074e4fd732c3975d1b49b23f878c6cfeaf1a8/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ContextualHelp with scrollbar is not keyboard accessibile

3 participants