Skip to content

Commit

Permalink
Scope to Zoom Out only for 6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave authored and jeryj committed Oct 18, 2024
1 parent 0982fd1 commit 185b059
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function useInsertionPoint( {
getBlockIndex,
getBlockOrder,
getSectionRootClientId,
__unstableGetEditorMode,
} = unlock( select( blockEditorStore ) );
const selectedBlockClientId = getSelectedBlockClientId();

Expand All @@ -95,7 +96,13 @@ function useInsertionPoint( {
} else if ( ! isAppender && selectedBlockClientId ) {
const sectionRootClientId = getSectionRootClientId();

if ( sectionRootClientId === selectedBlockClientId ) {
// Avoids empty inserter when the selected block is acting
// as the "root".
// See https://github.com/WordPress/gutenberg/pull/66214.
if (
__unstableGetEditorMode() === 'zoom-out' &&
sectionRootClientId === selectedBlockClientId
) {
_destinationRootClientId = sectionRootClientId;
_destinationIndex = getBlockOrder(
_destinationRootClientId
Expand Down

0 comments on commit 185b059

Please sign in to comment.