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 (WordPress#65529)

Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: mikachan <mikachan@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
  • Loading branch information
4 people committed Sep 20, 2024
1 parent 8e79558 commit 2c4d4d6
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 2c4d4d6

Please sign in to comment.