Skip to content

Commit

Permalink
Don't automatically show inserter when zoom out mode initiates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Jul 23, 2024
1 parent 859d48b commit d8d55b5
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { useEffect, useRef, useState } from '@wordpress/element';
import { useEffect, useState } from '@wordpress/element';

/**
* Internal dependencies
Expand Down Expand Up @@ -50,17 +50,6 @@ function ZoomOutModeInserters() {
};
}, [] );

const isMounted = useRef( false );

useEffect( () => {
if ( ! isMounted.current ) {
isMounted.current = true;
return;
}
// reset insertion point when the block order changes
setInserterIsOpened( true );
}, [ blockOrder, setInserterIsOpened ] );

// Defer the initial rendering to avoid the jumps due to the animation.
useEffect( () => {
const timeout = setTimeout( () => {
Expand Down

0 comments on commit d8d55b5

Please sign in to comment.