Focus loss when switching to draft #51901
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Edit Post
/packages/edit-post
[Package] Editor
/packages/editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
When switching a Published or Scheduled post to Draft:
disabled
attribute while saving.disabled
on focusable UI controls e.g. "Reset" buttons #15524Animated GIF to illustrate:
Worth noting the focus loss occurs also in WordPress 6.2, However, the Switch to Draft button was placed in the editor top bar. While the focus loss still occurs, I'd say it wa less serious because focus landed not that far from where it was.
Instead, with the new placement of the Switch to Draft button in the settings panel, users are now forced to navigate almost the entire editor UI to go back where they were.
The expected behavior is that focus is returned to the UI control that opened the modal dialog. As such, the 'Switch to Draft' button should not be removed from the DOM. Ideally, it shoul dstay in the DOM, be still focusable, use an
aria-disabled
attribute and 'noop'. See: ARIA Authoring Practices: Focusability of disabled controls.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
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: