Skip to content

Commit

Permalink
Select Mode: Prevent the inbetween inserter from triggering within se…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
youknowriad committed Sep 20, 2024
1 parent 2632234 commit 44e3c3f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { isRTL } from '@wordpress/i18n';
*/
import { store as blockEditorStore } from '../../store';
import { InsertionPointOpenRef } from '../block-tools/insertion-point';
import { unlock } from '../../lock-unlock';

export function useInBetweenInserter() {
const openRef = useContext( InsertionPointOpenRef );
Expand All @@ -31,7 +32,8 @@ export function useInBetweenInserter() {
getBlockEditingMode,
getBlockName,
getBlockAttributes,
} = useSelect( blockEditorStore );
getParentSectionBlock,
} = unlock( useSelect( blockEditorStore ) );
const { showInsertionPoint, hideInsertionPoint } =
useDispatch( blockEditorStore );

Expand Down Expand Up @@ -133,7 +135,8 @@ export function useInBetweenInserter() {
const clientId = element.id.slice( 'block-'.length );
if (
! clientId ||
__unstableIsWithinBlockOverlay( clientId )
__unstableIsWithinBlockOverlay( clientId ) ||
!! getParentSectionBlock( clientId )
) {
return;
}
Expand Down

0 comments on commit 44e3c3f

Please sign in to comment.