Skip to content

Commit

Permalink
Zoom Out: Disable zoom out toggle button when Style Book is open
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Oct 18, 2024
1 parent 3e2e434 commit 8402b8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Header( {
) }

{ canBeZoomedOut && isEditorIframed && isWideViewport && (
<ZoomOutToggle />
<ZoomOutToggle disabled={ forceDisableBlockTools } />
) }

<PreviewDropdown
Expand Down
4 changes: 3 additions & 1 deletion packages/editor/src/components/zoom-out-toggle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
*/
import { unlock } from '../../lock-unlock';

const ZoomOutToggle = () => {
const ZoomOutToggle = ( { disabled } ) => {
const { isZoomOut, showIconLabels } = useSelect( ( select ) => ( {
isZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(),
showIconLabels: select( preferencesStore ).get(
Expand All @@ -37,6 +37,8 @@ const ZoomOutToggle = () => {

return (
<Button
accessibleWhenDisabled
disabled={ disabled }
onClick={ handleZoomOut }
icon={ zoomOutIcon }
label={ __( 'Zoom Out' ) }
Expand Down

0 comments on commit 8402b8a

Please sign in to comment.