1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Fix DND not working in field groups and any other component where children are not rendered inside the first DOM node

This commit is contained in:
Andrew Kingston 2022-10-14 19:34:23 +01:00
parent 622553978b
commit 011ba26769

View file

@ -123,6 +123,14 @@
return
}
// As the first DOM node in a component may not necessarily contain the
// child components, we can find to try the parent of the first child
// component and use that as the real parent DOM node
const childNode = node.getElementsByClassName("component")[0]
if (childNode?.parentNode) {
node = childNode.parentNode
}
// Append an ephemeral div to allow us to determine layout if only one
// child exists
let ephemeralDiv