Skip to content

Commit

Permalink
Zoom Out: Don't prevent the inserted block from being focussed
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Dec 23, 2024
1 parent f78c60c commit 49eb4a2
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,13 @@ import { unlock } from '../../../lock-unlock';
*/
export function useFocusFirstElement( { clientId, initialPosition } ) {
const ref = useRef();
const { isBlockSelected, isMultiSelecting, isZoomOut } = unlock(
const { isBlockSelected, isMultiSelecting } = unlock(
useSelect( blockEditorStore )
);

useEffect( () => {
// Check if the block is still selected at the time this effect runs.
if (
! isBlockSelected( clientId ) ||
isMultiSelecting() ||
isZoomOut()
) {
if ( ! isBlockSelected( clientId ) || isMultiSelecting() ) {
return;
}

Expand Down

0 comments on commit 49eb4a2

Please sign in to comment.