Botch of focus return when dismissing Modal
by clicking outside
#51722
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
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
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 ofModal
. 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
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
The text was updated successfully, but these errors were encountered: