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

docs: add focus restoration to our examples, and update the docs to reflect authoring requirements #33924

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

smhigley
Copy link
Contributor

Previous Behavior

Most of our examples did not restore focus from the drawer when closed. This is because Drawer does not include a trigger as Dialog does, so the triggering buttons do not have the required tabster attributes to handle focus restoration. The result is that the modal drawer surface does have the tabster attrs to try to restore focus, but will send it back to some other random trigger on the page.

The docs make it seem like the goal was to automatically handle focus restoration for OverlayDrawers, but that doesn't seem possible, since it doesn't look like Drawer was designed to have the trigger as a child. Let me know if I've misunderstood how it's intended to work, though.

New Behavior

All our examples (aside from some inline drawers that are left as-is to demo intentional lack of focus restoration) add the correct tabster attributes, and the a11y docs are also updated to reflect that behavior.

Related Issue(s)

@smhigley smhigley requested review from marcosmoura and a team as code owners February 28, 2025 01:06
Copy link

📊 Bundle size report

✅ No changes found

Copy link

Pull request demo site: URL

@ValentinaKozlova ValentinaKozlova self-requested a review February 28, 2025 13:01
@smhigley smhigley merged commit c28f731 into microsoft:master Feb 28, 2025
15 of 16 checks passed
@smhigley smhigley deleted the drawer-focus-restoration branch February 28, 2025 17:02
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.

2 participants