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

Botch of focus return when dismissing Modal by clicking outside #51722

Closed
stokesman opened this issue Jun 21, 2023 · 0 comments · Fixed by #52653
Closed

Botch of focus return when dismissing Modal by clicking outside #51722

stokesman opened this issue Jun 21, 2023 · 0 comments · Fixed by #52653
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@stokesman
Copy link
Contributor

Description

When a modal is dismissed, focus is expected to return to the element that opened the modal. This fails when dismissing a modal by clicking outside it.

Step-by-step reproduction instructions

  1. Start in the Post Editor
  2. Open the Options menu
  3. Open the Preferences modal
  4. Click outside the Preferences modal to dismiss it
  5. Observe the Options menu is still open and clicking or focus other elements does not cause it to close.

Screenshots, screen recording, code snippet

Here are a couple instances of the issue but there are more uses of Modal that are probably affected.

Preferences modal

Google.Chrome.-.Edit.Post.My.WordPress.Website.WordPress.2023-06-20.at.8.46.52.PM.mp4

Post visibility confimation dialog

This is a ConfirmDialog which is built on top of Modal. I would expect the visibility dropdown menu would stay open and the focus return to the 'private' radio.

Google.Chrome.-.Edit.Post.My.WordPress.Website.WordPress.2023-06-20.at.8.40.39.PM.mp4

Environment info

  • Gutenberg trunk running on wp-now
  • Chrome
  • macOS

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@stokesman stokesman added [Package] Components /packages/components [Type] Bug An existing feature does not function as intended labels Jun 21, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 14, 2023
@priethor priethor added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed [a11y] Keyboard & Focus labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants