Skip to content

fix(react-dialog): enable keyboard scrolling in long content story - #36736

Draft
Moura (Rodrigorm33) wants to merge 1 commit into
microsoft:masterfrom
Rodrigorm33:fix/35603-dialog-keyboard-scroll
Draft

Moura (Rodrigorm33) wants to merge 1 commit into
microsoft:masterfrom
Rodrigorm33:fix/35603-dialog-keyboard-scroll

Conversation

@Rodrigorm33

@Rodrigorm33 Moura (Rodrigorm33) commented Sep 15, 2026

Copy link
Copy Markdown

Hi! This fixes keyboard scrolling in the Dialog "Scrolling Long Content" example (#35603).

Previous Behavior

In the Scrolling Long Content Dialog story, the overflowing content could be scrolled with the mouse but not with the keyboard. The content had no focusable element, so focus landed on Do Something when the Dialog opened, and PageDown/arrow keys did not scroll the content.

New Behavior

The story passes tabIndex={0} to DialogContent, so focus lands on the content when the Dialog opens and it can be scrolled with PageDown and the arrow keys. Escape still closes the Dialog and restores focus to the trigger. The story description now explains when to use this pattern.

The change is limited to the example, following bsunderhus's suggestion in #35612. No Dialog runtime or public API code changed, and the story path is excluded from Beachball change-file requirements.

Tested in Edge at 1280×800 and 1280×340: focus cycles through the content, Do Something and Close, and PageDown scrolls the content (or the Dialog surface at the shorter height).

Open question: the browser's native focus indicator is kept for now. Fluent focus styles were requested in #35612 for the component-level change; I can apply them to this example if that is expected here.

Related Issue(s)

Thanks for taking a look!

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.

[Bug]: Dialog Component: can't scroll with keyboard in 'Long content' example

1 participant