Fixed editor drag/drop getting stuck

no issue

- sometimes it was possible for a drop target element to not have a child which would cause an error and cause drag/drop to get stuck with the dragged element sticking to the cursor with no action occurring on mouseup, requiring an `Esc` press but all further drags also being broken
- added a guard so we can handle `element.firstChild` not existing
This commit is contained in:
Kevin Ansfield 2021-03-09 17:56:27 +00:00
parent 0ae423bbb4
commit f24f6e5d0d

View File

@ -1234,9 +1234,11 @@ export default Component.extend({
return;
}
let cardId = cardElement.firstChild.id;
let cardId = cardElement.firstChild?.id;
return this.componentCards.findBy('destinationElementId', cardId);
if (cardId) {
return this.componentCards.findBy('destinationElementId', cardId);
}
},
getSectionFromCard(card) {