ToolbarButton: aria-disabled prop is also given the disabled attribute at the same time #57701
Labels
[Package] Components
/packages/components
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
For
Button
component, thearia-disabled
prop is used instead of thedisabled
prop to make the button inactive but still focusable.For example, the Undo/Redo button in the Post Editor or Site Editor.
gutenberg/packages/editor/src/components/editor-history/undo.js
Lines 23 to 36 in 5380b6c
On the other hand,
ToolbarButton
is used for the Undo/Redo button in the Widget Editor.gutenberg/packages/edit-widgets/src/components/header/undo-redo/undo.js
Lines 18 to 27 in 5380b6c
It's mentioned that the
ToolbarButton
component accepts the same API as theButton
component, but it seems like thearia-disabled
prop also opts into thedisabled
prop at the same time.As a result, as mentioned in #57647 and #57678, it is not possible to focus the Undo/Redo button in the Widget Editor when it is not enabled.
This can be solved by refactoring the Undo/Redo button into the
Button
component, as attempted in #57677, but if the current behavior ofToobarButton
is not what we intended, I think it will need to be fixed.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Note: In the screencast below, you can also see that the focus outline is cut off, but this issue should also be fixed separately.
46eeb77c2538939e5282514bff9b1edf.mp4
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: