Check for DOM node existence before removing class. (#4696)

Can cause issues if dragstart and dragend actions trigger a refresh.
optimising-macrocalls
saqimtiaz 2020-06-11 13:11:56 +02:00 zatwierdzone przez GitHub
rodzic e01b354f7d
commit 25f8b3f903
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -75,7 +75,9 @@ DroppableWidget.prototype.leaveDrag = function(event) {
// Remove highlighting if we're leaving externally. The hacky second condition is to resolve a problem with Firefox whereby there is an erroneous dragenter event if the node being dragged is within the dropzone
if(this.currentlyEntered.length === 0 || (this.currentlyEntered.length === 1 && this.currentlyEntered[0] === $tw.dragInProgress)) {
this.currentlyEntered = [];
$tw.utils.removeClass(this.domNodes[0],"tc-dragover");
if(this.domNodes[0]) {
$tw.utils.removeClass(this.domNodes[0],"tc-dragover");
}
}
};