fix: Fixed issue where dragging a list item with a link in Super would only re-order the link

This commit is contained in:
Aman Harwara
2023-08-18 20:04:46 +05:30
parent 6559c66ecf
commit d79484739b

View File

@@ -74,7 +74,8 @@ function elementContainingEventLocation(
const children = Array.from(element.children) 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) { if (shouldRecurseIntoChildren) {
for (const child of children) { for (const child of children) {
@@ -82,6 +83,9 @@ function elementContainingEventLocation(
if (isLeaf) { if (isLeaf) {
continue continue
} }
if (!recursableTags.includes(child.tagName)) {
continue
}
const childResult = elementContainingEventLocation(anchorElem, child as HTMLElement, eventLocation) const childResult = elementContainingEventLocation(anchorElem, child as HTMLElement, eventLocation)
if (childResult.contains.result) { if (childResult.contains.result) {