Skip to content

Commit

Permalink
fix: Synced menu option with aria label for better a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
im3dabasia committed Jan 10, 2025
1 parent ddfbdcc commit 1f3a346
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,12 @@ const OptionalControlsGroup = ( {
return (
<>
{ items.map( ( [ label, isSelected ] ) => {
const itemLabel = isSelected
? sprintf(
// translators: %s: The name of the control being hidden and reset e.g. "Padding".
__( 'Hide and reset %s' ),
label
)
: sprintf(
// translators: %s: The name of the control to display e.g. "Padding".
_x( 'Show %s', 'input control' ),
label
);

return (
<MenuItem
key={ label }
icon={ isSelected ? check : null }
isSelected={ isSelected }
label={ itemLabel }
label={ label }
onClick={ () => {
if ( isSelected ) {
speak(
Expand Down

0 comments on commit 1f3a346

Please sign in to comment.