From a1c9562aa27b8b7f1315efdf31bd9a848c774771 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 18 Jan 2021 09:51:58 +0100 Subject: [PATCH] Fix for aligned blocks --- .../src/components/block-list/insertion-point.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 79faff5df3d62..b3d04a27281cf 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' ); }