Skip to content

Commit

Permalink
Don't automatically show inserter when zoom out mode initiates (#63859)
Browse files Browse the repository at this point in the history
Co-authored-by: jeryj <jeryj@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
  • Loading branch information
3 people committed Jul 24, 2024
1 parent a15e048 commit c5f3dd5
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 c5f3dd5

Please sign in to comment.