Skip to content

Commit

Permalink
Normalize focusable disabled ToolbarButton usage (WordPress#63130)
Browse files Browse the repository at this point in the history
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored and carstingaxion committed Jul 18, 2024
1 parent d0747d9 commit cb4f6f6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/src/components/block-lock/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default function BlockLockToolbar( { clientId } ) {
<>
<ToolbarGroup className="block-editor-block-lock-toolbar">
<ToolbarButton
accessibleWhenDisabled
disabled={ ! canLock }
icon={ isLocked ? lock : unlock }
label={ label }
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ function ReusableBlockEdit( {
<ToolbarButton
onClick={ resetContent }
disabled={ ! content }
__experimentalIsFocusable
>
{ __( 'Reset' ) }
</ToolbarButton>
Expand Down
10 changes: 2 additions & 8 deletions packages/customize-widgets/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ function Header( {
/* translators: button label text should, if possible, be under 16 characters. */
label={ __( 'Undo' ) }
shortcut={ displayShortcut.primary( 'z' ) }
// If there are no undo levels we don't want to actually disable this
// button, because it will remove focus for keyboard users.
// See: https://github.com/WordPress/gutenberg/issues/3486
aria-disabled={ ! hasUndo }
disabled={ ! hasUndo }
onClick={ sidebar.undo }
className="customize-widgets-editor-history-button undo-button"
/>
Expand All @@ -69,10 +66,7 @@ function Header( {
/* translators: button label text should, if possible, be under 16 characters. */
label={ __( 'Redo' ) }
shortcut={ shortcut }
// If there are no undo levels we don't want to actually disable this
// button, because it will remove focus for keyboard users.
// See: https://github.com/WordPress/gutenberg/issues/3486
aria-disabled={ ! hasRedo }
disabled={ ! hasRedo }
onClick={ sidebar.redo }
className="customize-widgets-editor-history-button redo-button"
/>
Expand Down
1 change: 0 additions & 1 deletion packages/dataviews/src/bulk-actions-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ function ActionTrigger< Item >( {
size="compact"
onClick={ onClick }
isBusy={ isBusy }
__experimentalIsFocusable
tooltipPosition="top"
/>
);
Expand Down
6 changes: 1 addition & 5 deletions packages/patterns/src/components/reset-overrides-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ export default function ResetOverridesControl( props ) {
return (
<BlockControls group="other">
<ToolbarGroup>
<ToolbarButton
onClick={ onClick }
disabled={ ! isOverriden }
__experimentalIsFocusable
>
<ToolbarButton onClick={ onClick } disabled={ ! isOverriden }>
{ __( 'Reset' ) }
</ToolbarButton>
</ToolbarGroup>
Expand Down

0 comments on commit cb4f6f6

Please sign in to comment.