-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Focus loss when closing the block toolbar with the Escape key #45767
Comments
Quickly testing previous WordPress versions, here's what pressing the Escape key does:
Expected:
|
Looking a bit into this, I'm not sure I'm able to fully follow the current implementation. Seems to me the desired behaviior is just not implemented. To recap, the expected interaction is:
Most of the code responsible for this is here. However, I'm not sure it works as expected, now that the editor is iframed. Cc @Mamaduka @ellatrix |
I've been looking into this as part of rendering the top toolbar in the DOM. I also did not see anything trying to implement an If we can get the concepts from #53779 merged (I'm working on a cleaner follow-up now), then it will include |
Fixed by #55712 |
Thank you for all your work on this issue @jeryj ❤️ |
Description
When closing the block toolbar with the Escape key, focus is lost.
Expected: to return focus back to the selected block, regardless of whether it's in 'Edit' or 'Select' mode.
This is a regression as the previous behavior was returning focus to the selected block.
See also #41508 and #41509
Step-by-step reproduction instructions
Shift + Tab
keys to move focus to the block toolbar.At this point, pressing for example
Shift + Tab
moves focus to the 'Options' button within the editor top bar. PressintTab
moves focus to the post title. This is one more signal that focus was lost. The tab sequence starts from the most logical place just because modern browsers have a feature called 'sequential focus navigation starting point' but focus was actually lost.Screenshots, screen recording, code snippet
In the animated GIF below I'm using a strong red focus outline to make things clearer.
Environment info
No response
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: