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

Edit Widgets: Undo and Redo button use both disabled and aria-disabled #57647

Closed
afercia opened this issue Jan 8, 2024 · 1 comment · Fixed by #57677
Closed

Edit Widgets: Undo and Redo button use both disabled and aria-disabled #57647

afercia opened this issue Jan 8, 2024 · 1 comment · Fixed by #57677
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Edit Widgets /packages/edit-widgets [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jan 8, 2024

Description

The 'disabled' attribute on interactive controls should be user rarely and only for good reasons. Gutenberg uses a different pattern to make disabled control still focusable and discoverable:

  • aria-disabled instead of disabled
  • noop the control

Additionally, the focus focus style on all the 'Document tools' ARIA toolbar looks broken because of some CSS overflow property set on a container.

Step-by-step reproduction instructions

  • For comparison, edit a post and make sure there are no undo / redo steps.
  • Use the keyboard and press the Tab key to navigate the top bar.
  • Once focus is on the Inserter button, you are inside the 'Document tools' ARIA toolbar. Now use the right and left arrow keys to move through the buttons.
  • Observe the Undo and Redo buttons look disabled but they do receive focus.
  • Set Twenty Twenty-One as your active theme.
  • Go to Appearance > Widgets and make sure there are no undo / redo steps.
  • Try to navigate through the Document tools buttons as described above.
  • Observe the Undo and Redo buttons are not focusable.
  • Observe the frocus style on the other buttons looks broken.
  • Inspect the DOM in the browser dev tools and observe the Undo and Redo buttons have both a disabled and an aria-disabled buttons. They are really disabled. Screenshot:

Screenshot 2024-01-08 at 15 26 40

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

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Edit Widgets /packages/edit-widgets labels Jan 8, 2024
@Mamaduka Mamaduka changed the title Edit Widgets: Unoo and Redo button use both disabled and aria-disabled Edit Widgets: Undo and Redo button use both disabled and aria-disabled Jan 9, 2024
@afercia afercia self-assigned this Jan 9, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Jan 10, 2024

I believe that the root cause of this problem is the difference in specifications between the ToolbarButton and Button components. I have summarized the details in #57701.

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] Edit Widgets /packages/edit-widgets [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