Skip to content

Commit

Permalink
remove speak from device menu selection (#64115)
Browse files Browse the repository at this point in the history
Co-authored-by: up1512001 <[email protected]>
Co-authored-by: jeryj <[email protected]>
  • Loading branch information
3 people authored Jul 30, 2024
1 parent 602b5fa commit 060d4ca
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
*/
import { store as editorStore } from '../../store';
import PostPreviewButton from '../post-preview-button';
import { speak } from '@wordpress/a11y';

export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
const { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =
Expand Down Expand Up @@ -103,22 +102,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
selectedChoice = choices[ 0 ];
}

/**
* Handles the selection of a device type.
*
* @param {string} value The device type.
*/
const onSelect = ( value ) => {
setDeviceType( value );
if ( value === 'Desktop' ) {
speak( __( 'Desktop selected' ), 'assertive' );
} else if ( value === 'Tablet' ) {
speak( __( 'Tablet selected' ), 'assertive' );
} else {
speak( __( 'Mobile selected' ), 'assertive' );
}
};

return (
<DropdownMenu
className="editor-preview-dropdown"
Expand All @@ -135,7 +118,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
<MenuItemsChoice
choices={ choices }
value={ selectedChoice.value }
onSelect={ onSelect }
onSelect={ setDeviceType }
/>
</MenuGroup>
{ isTemplate && (
Expand Down

0 comments on commit 060d4ca

Please sign in to comment.