diff --git a/packages/block-editor/src/components/block-navigation/expander.js b/packages/block-editor/src/components/block-navigation/expander.js index 585a8ef53be65..cb5ec6ab3f311 100644 --- a/packages/block-editor/src/components/block-navigation/expander.js +++ b/packages/block-editor/src/components/block-navigation/expander.js @@ -5,10 +5,18 @@ import { chevronRightSmall, Icon } from '@wordpress/icons'; export default function BlockNavigationExpander( { onClick } ) { return ( // Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js + // + // The expander component is implemented as a pseudo element in the w3 example + // https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html + // + // We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree. + // For the current tree grid implementation, please do not try to make this a button. + // // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions onClick( event, { forceToggle: true } ) } + aria-hidden="true" >