Skip to content

Commit

Permalink
Fix: accessibility issue of menugroup
Browse files Browse the repository at this point in the history
  • Loading branch information
up1512001 committed Jul 25, 2024
1 parent 9a8be7c commit 8968a2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,21 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
<MenuItem
onClick={ () => setDeviceType( 'Desktop' ) }
icon={ deviceType === 'Desktop' && check }
aria-label={ __( 'Desktop View' ) }
>
{ __( 'Desktop' ) }
</MenuItem>
<MenuItem
onClick={ () => setDeviceType( 'Tablet' ) }
icon={ deviceType === 'Tablet' && check }
aria-label={ __( 'Tablet View' ) }
>
{ __( 'Tablet' ) }
</MenuItem>
<MenuItem
onClick={ () => setDeviceType( 'Mobile' ) }
icon={ deviceType === 'Mobile' && check }
aria-label={ __( 'Mobile View' ) }
>
{ __( 'Mobile' ) }
</MenuItem>
Expand Down Expand Up @@ -118,6 +121,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
className="editor-preview-dropdown__button-external"
role="menuitem"
forceIsAutosaveable={ forceIsAutosaveable }
aria-label={ __( 'Preview in new tab' ) }
textContent={
<>
{ __( 'Preview in new tab' ) }
Expand Down

0 comments on commit 8968a2d

Please sign in to comment.