Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/components/src/toolbar/toolbar-button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Button from '../../button';
import ToolbarItem from '../toolbar-item';
import ToolbarContext from '../toolbar-context';
import ToolbarButtonContainer from './toolbar-button-container';
import type { ToolbarButtonDeprecatedProps, ToolbarButtonProps } from './types';
import type { ToolbarButtonOverriddenProps, ToolbarButtonProps } from './types';
import type { WordPressComponentProps } from '../../context';

function useDeprecatedProps( {
Expand All @@ -32,9 +32,9 @@ function useDeprecatedProps( {
function UnforwardedToolbarButton(
props: Omit<
WordPressComponentProps< ToolbarButtonProps, typeof Button, false >,
'__experimentalIsFocusable' // ToolbarButton will always be focusable even when disabled.
'accessibleWhenDisabled' // By default, ToolbarButton will be focusable when disabled.
> &
ToolbarButtonDeprecatedProps,
ToolbarButtonOverriddenProps,
ref: ForwardedRef< any >
) {
const {
Expand Down
14 changes: 10 additions & 4 deletions packages/components/src/toolbar/toolbar-button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ export type ToolbarButtonProps = {
title?: string;
};

export type ToolbarButtonDeprecatedProps = {
export type ToolbarButtonOverriddenProps = {
/**
* Whether to keep the button focusable when disabled.
*
* @deprecated ToolbarButton will always be focusable even when disabled.
* @ignore
* In most cases, it is recommended to set this to `true`. Disabling a control without maintaining focusability
* can cause accessibility issues, by hiding their presence from screen reader users,
* or by preventing focus from returning to a trigger element.
*
* Learn more about the [focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)
* in the WAI-ARIA Authoring Practices Guide.
*
* @default true
*/
__experimentalIsFocusable?: boolean;
accessibleWhenDisabled?: boolean;
};

export type ToolbarButtonContainerProps = {
Expand Down