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

[core] fix(Popover): return focus to target on ESC keypress #6587

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

adidahiya
Copy link
Contributor

Changes proposed in this pull request:

  • fix(Popover): improve keyboard a11y: always return focus to target element when an ESC keypress closes the popover

Reviewers should focus on:

Updated behavior in docs example.

Note that we need to be conservative here and not enable this behavior for all keyboard interactions because there may be some interactions where a confirmation action (e.g. "Enter" key) on a "popover dismiss element" (like a MenuItem) pulls the user's focus away from the popover, and we don't want to break that kind of functionality.

Screenshot

Returns focus on ESC key:

2023-12-06 18 18 26

Does not return focus (previous behavior) on Enter key:

2023-12-06 18 18 56

@adidahiya
Copy link
Contributor Author

[core] fix(Popover): return focus to target on ESC keypress

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

revert rename typo

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya adidahiya merged commit c0cbdc2 into develop Dec 7, 2023
12 checks passed
@adidahiya adidahiya deleted the ad/return-focus-on-close-esc-key branch December 7, 2023 15:35
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.

1 participant