Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove: speak from device menu selection #64115

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading