Skip to content

Commit

Permalink
update: aria label when device type is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
up1512001 committed Jul 26, 2024
1 parent 8968a2d commit f5e7766
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,33 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
<MenuItem
onClick={ () => setDeviceType( 'Desktop' ) }
icon={ deviceType === 'Desktop' && check }
aria-label={ __( 'Desktop View' ) }
aria-label={
deviceType === 'Desktop'
? __( 'Desktop Selected' )
: __( 'Desktop' )
}
>
{ __( 'Desktop' ) }
</MenuItem>
<MenuItem
onClick={ () => setDeviceType( 'Tablet' ) }
icon={ deviceType === 'Tablet' && check }
aria-label={ __( 'Tablet View' ) }
aria-label={
deviceType === 'Tablet'
? __( 'Tablet Selected' )
: __( 'Tablet' )
}
>
{ __( 'Tablet' ) }
</MenuItem>
<MenuItem
onClick={ () => setDeviceType( 'Mobile' ) }
icon={ deviceType === 'Mobile' && check }
aria-label={ __( 'Mobile View' ) }
aria-label={
deviceType === 'Mobile'
? __( 'Mobile Selected' )
: __( 'Mobile' )
}
>
{ __( 'Mobile' ) }
</MenuItem>
Expand Down

0 comments on commit f5e7766

Please sign in to comment.