docs: add focus restoration to our examples, and update the docs to reflect authoring requirements #33924
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.
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)