Hello everyone, I have a question.
handleUp(e: PointerEvent) {
if (!this.isDragging()) {
this.handleTouchEnd(e);
}
if (!this.isMultiTouch() || this.isDragging()) {
if (!Touch.shouldHandleEvent(e)) {
return;
}
this.updateFromEvent(e);
Touch.longStop();
if (this.isEnding_) {
console.log("Trying to end a gesture recursively.");
return;
}
this.isEnding_ = true;
// PROBLEM: If any of these throw an exception, dispose() won't be called
if (this.dragger) {
this.dragger.onDragEnd(e, this.currentDragDeltaXY);
} else if (this.workspaceDragger) {
this.workspaceDragger.endDrag(this.currentDragDeltaXY);
} else if (this.isBubbleClick()) {
// ...
} // ... more conditionals
e.preventDefault();
e.stopPropagation();
this.dispose(); // ⚠️ Never reached if exception thrown above
} else {
e.preventDefault();
e.stopPropagation();
this.dispose(); // ⚠️ Never reached if exception thrown above
}
}
···