diff --git a/packages/block-editor/src/components/block-settings-menu/block-convert-button.js b/packages/block-editor/src/components/block-settings-menu/block-convert-button.js index 992292e04a5f5..17ed717046494 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-convert-button.js +++ b/packages/block-editor/src/components/block-settings-menu/block-convert-button.js @@ -15,7 +15,6 @@ export default function BlockConvertButton( { shouldRender, onClick, small } ) { className="editor-block-settings-menu__control" onClick={ onClick } icon="screenoptions" - label={ small ? label : undefined } > { ! small && label } diff --git a/packages/block-editor/src/components/block-settings-menu/block-mode-toggle.js b/packages/block-editor/src/components/block-settings-menu/block-mode-toggle.js index ffafcffff75f5..b4d881b103d2c 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-mode-toggle.js +++ b/packages/block-editor/src/components/block-settings-menu/block-mode-toggle.js @@ -26,7 +26,6 @@ export function BlockModeToggle( { blockType, mode, onToggleMode, small = false className="editor-block-settings-menu__control" onClick={ onToggleMode } icon="html" - label={ small ? label : undefined } > { ! small && label } diff --git a/packages/components/src/menu-item/README.md b/packages/components/src/menu-item/README.md index eacd6770f7aaf..38251ccedf261 100644 --- a/packages/components/src/menu-item/README.md +++ b/packages/components/src/menu-item/README.md @@ -34,15 +34,6 @@ Element to render as child of button. Element -### `label` - -- Type: `string` -- Required: No - -String to use as primary button label text, applied as `aria-label`. Useful in cases where an `info` prop is passed, where `label` should be the minimal text of the button, described in further detail by `info`. - -Defaults to the value of `children`, if `children` is passed as a string. - ### `info` - Type: `string` diff --git a/packages/components/src/menu-item/index.js b/packages/components/src/menu-item/index.js index 860430b4ecb67..1b793a2c5cf26 100644 --- a/packages/components/src/menu-item/index.js +++ b/packages/components/src/menu-item/index.js @@ -30,7 +30,6 @@ export function MenuItem( { shortcut, isSelected, role = 'menuitem', - instanceId, ...props } ) { className = classnames( 'components-menu-item__button', className, { @@ -38,16 +37,10 @@ export function MenuItem( { } ); if ( info ) { - const infoId = 'edit-post-feature-toggle__info-' + instanceId; - - // Deconstructed props is scoped to the function; mutation is fine. - props[ 'aria-describedby' ] = infoId; - children = ( { children } { info } diff --git a/packages/components/src/menu-item/test/__snapshots__/index.js.snap b/packages/components/src/menu-item/test/__snapshots__/index.js.snap index a0f00b2889f00..d029c29c0cb3a 100644 --- a/packages/components/src/menu-item/test/__snapshots__/index.js.snap +++ b/packages/components/src/menu-item/test/__snapshots__/index.js.snap @@ -18,7 +18,6 @@ exports[`MenuItem should match snapshot when all props provided 1`] = ` exports[`MenuItem should match snapshot when info is provided 1`] = ` @@ -28,7 +27,6 @@ exports[`MenuItem should match snapshot when info is provided 1`] = ` My item Extended description of My Item diff --git a/packages/components/src/menu-item/test/index.js b/packages/components/src/menu-item/test/index.js index f521add7452c8..63ac41b337dff 100644 --- a/packages/components/src/menu-item/test/index.js +++ b/packages/components/src/menu-item/test/index.js @@ -54,7 +54,7 @@ describe( 'MenuItem', () => { it( 'should match snapshot when info is provided', () => { const wrapper = shallow( - + My item ); diff --git a/packages/edit-post/src/components/header/feature-toggle/index.js b/packages/edit-post/src/components/header/feature-toggle/index.js index 4e0df7f3749b0..b855ca046c386 100644 --- a/packages/edit-post/src/components/header/feature-toggle/index.js +++ b/packages/edit-post/src/components/header/feature-toggle/index.js @@ -26,7 +26,6 @@ function FeatureToggle( { onToggle, isActive, label, info, messageActivated, mes isSelected={ isActive } onClick={ flow( onToggle, speakMessage ) } role="menuitemcheckbox" - label={ label } info={ info } > { label } diff --git a/packages/edit-post/src/components/header/plugin-more-menu-item/test/__snapshots__/index.js.snap b/packages/edit-post/src/components/header/plugin-more-menu-item/test/__snapshots__/index.js.snap index 6e395b2e7ebae..7fa0869a60f22 100644 --- a/packages/edit-post/src/components/header/plugin-more-menu-item/test/__snapshots__/index.js.snap +++ b/packages/edit-post/src/components/header/plugin-more-menu-item/test/__snapshots__/index.js.snap @@ -18,6 +18,7 @@ exports[`PluginMoreMenuItem renders menu item as button properly 1`] = ` >