diff --git a/packages/block-editor/src/components/block-list/insertion-point.js b/packages/block-editor/src/components/block-list/insertion-point.js index 79faff5df3d621..b3d04a27281cfb 100644 --- a/packages/block-editor/src/components/block-list/insertion-point.js +++ b/packages/block-editor/src/components/block-list/insertion-point.js @@ -209,11 +209,11 @@ export default function useInsertionPoint( ref ) { let rootClientId; if ( ! event.target.classList.contains( 'is-root-container' ) ) { - const blockElement = event.target.classList.contains( - 'wp-block' + const blockElement = !! event.target.getAttribute( + 'data-block' ) ? event.target - : event.target.closest( '.wp-block' ); + : event.target.closest( '[data-block]' ); rootClientId = blockElement.getAttribute( 'data-block' ); }