From d79484739b2a324f09cb821c39f402f8c65d477e Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 18 Aug 2023 20:04:46 +0530 Subject: [PATCH] fix: Fixed issue where dragging a list item with a link in Super would only re-order the link --- .../SuperEditor/Plugins/DraggableBlockPlugin/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/web/src/javascripts/Components/SuperEditor/Plugins/DraggableBlockPlugin/index.tsx b/packages/web/src/javascripts/Components/SuperEditor/Plugins/DraggableBlockPlugin/index.tsx index 473d9dfd0..40cd8aa5f 100644 --- a/packages/web/src/javascripts/Components/SuperEditor/Plugins/DraggableBlockPlugin/index.tsx +++ b/packages/web/src/javascripts/Components/SuperEditor/Plugins/DraggableBlockPlugin/index.tsx @@ -74,7 +74,8 @@ function elementContainingEventLocation( const children = Array.from(element.children) - const shouldRecurseIntoChildren = ['UL', 'OL', 'LI'].includes(element.tagName) + const recursableTags = ['UL', 'OL', 'LI'] + const shouldRecurseIntoChildren = recursableTags.includes(element.tagName) if (shouldRecurseIntoChildren) { for (const child of children) { @@ -82,6 +83,9 @@ function elementContainingEventLocation( if (isLeaf) { continue } + if (!recursableTags.includes(child.tagName)) { + continue + } const childResult = elementContainingEventLocation(anchorElem, child as HTMLElement, eventLocation) if (childResult.contains.result) {