diff --git a/packages/editor/src/components/preview-dropdown/index.js b/packages/editor/src/components/preview-dropdown/index.js index 38565f4b04abed..0fbb2beb62665e 100644 --- a/packages/editor/src/components/preview-dropdown/index.js +++ b/packages/editor/src/components/preview-dropdown/index.js @@ -28,6 +28,7 @@ import { ActionItem } from '@wordpress/interface'; import { store as editorStore } from '../../store'; import { store as blockEditorStore } from '@wordpress/block-editor'; import PostPreviewButton from '../post-preview-button'; +import { unlock } from '../../lock-unlock'; export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) { const { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } = @@ -46,10 +47,12 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) { }, [] ); const { setDeviceType } = useDispatch( editorStore ); const { __unstableSetEditorMode } = useDispatch( blockEditorStore ); + const { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) ); const handleDevicePreviewChange = ( newDeviceType ) => { setDeviceType( newDeviceType ); __unstableSetEditorMode( 'edit' ); + resetZoomLevel(); }; const isMobile = useViewportMatch( 'medium', '<' );