-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: Dialog Component: can't scroll with keyboard in 'Long content' example. #35612
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
base: master
Are you sure you want to change the base?
Conversation
|
@microsoft-github-policy-service agree |
| // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement` | ||
| // but since it would be a breaking change to fix it, we are casting ref to it's proper type | ||
| ref: ref as React.Ref<HTMLDivElement>, | ||
| tabIndex: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls follow https://storybooks.fluentui.dev/react/?path=/docs/concepts-developer-accessibility-focus-indicator--docs to add focus indicator.
in general - I am not sure if this is applicable in all cases.
It is certainly not needed for smaller dialogs.
For larger ones there can be a focusable element in the content which will allow users to scroll when after move focus.
Maybe an optional prop? @kolaps33 @smhigley @bsunderhus what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added tabIndex: 0 in order to make the component focusable and thus to enable scrolling.
I dont quite understand why do we have to add focus indicator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the element to HTMLDivElement

Previous Behavior
In the Dialog Scrolling Long Content example, the dialog content is not scrollable with keyboard.
New Behavior
Now the dialog conent is scrollable by keyboard when it is in focus.
Related Issue(s)
#35603