V2 BottomSheet Focus Accessibility: Auto Expansion for content focus in sliderOver #635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The sheetContent wasn't scrolling as the focus moved to next item which was below the visible region, making it inaccessible for physical keyboard users.
Root cause
The slideOver component is designed with a fixed height and relies on the expanded state to initiate scrolling. However, this design did not account for the dynamic focus changes occurring when users navigate the content with a keyboard.
Fix
To enhance accessibility and ensure seamless keyboard navigation, we’ve introduced an auto-expansion feature for the sheet. This feature activates when any of the sheet’s contents gain focus, thereby enabling the content to scroll into view. This improvement has been thoroughly tested with slideOver = true and Expandable = false configurations, confirming that scrolling functions correctly in all scenarios.
v2BottomSheet_auto_expand.webm