Skip to content

Commit

Permalink
Mobile - Set accessibility label prop for BlockTypesList instances
Browse files Browse the repository at this point in the history
  • Loading branch information
geriux committed Feb 15, 2023
1 parent bff19d2 commit 7f99005
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
usePreferredColorScheme,
usePreferredColorSchemeStyle,
} from '@wordpress/compose';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -33,6 +32,7 @@ export default function BlockTypesList( {
name,
sections,
onSelect,
label,
listProps,
initialNumToRender = 3,
} ) {
Expand Down Expand Up @@ -155,7 +155,7 @@ export default function BlockTypesList( {
<SectionList
onLayout={ onLayout }
testID={ `InserterUI-${ name }` }
accessibilityLabel={ __( 'Blocks menu' ) }
accessibilityLabel={ label }
keyboardShouldPersistTaps="always"
sections={ sections }
initialNumToRender={ initialNumToRender }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useMemo } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -66,6 +67,7 @@ function BlockTypesTab( { onSelect, rootClientId, listProps } ) {
sections={ sections }
onSelect={ handleSelect }
listProps={ listProps }
label={ __( 'Blocks menu' ) }
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -31,6 +32,7 @@ function ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {
sections={ sections }
onSelect={ onSelect }
listProps={ listProps }
label={ __( 'Reusable blocks' ) }
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -54,6 +55,7 @@ function InserterSearchResults( {
sections={ [ createInserterSection( { key: 'search', items } ) ] }
onSelect={ handleSelect }
listProps={ listProps }
label={ __( 'Blocks' ) }
/>
);
}
Expand Down

0 comments on commit 7f99005

Please sign in to comment.