Merge pull request #16786 from calixteman/editor_resizers_blur

[Editor] Stop the resize session when the window is blurred
This commit is contained in:
calixteman 2023-08-03 13:47:11 +02:00 committed by GitHub
commit be29a4dce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -464,15 +464,18 @@ class AnnotationEditor {
this._uiManager.stopUndoAccumulation(); this._uiManager.stopUndoAccumulation();
this.div.draggable = savedDraggable; this.div.draggable = savedDraggable;
this.parent.div.classList.remove(resizingClassName); this.parent.div.classList.remove(resizingClassName);
window.removeEventListener("pointerup", pointerUpCallback);
window.removeEventListener("blur", pointerUpCallback);
window.removeEventListener( window.removeEventListener(
"pointermove", "pointermove",
boundResizerPointermove, boundResizerPointermove,
pointerMoveOptions pointerMoveOptions
); );
}; };
window.addEventListener("pointerup", pointerUpCallback, { window.addEventListener("pointerup", pointerUpCallback);
once: true, // If the user switch to another window (with alt+tab), then we end the
}); // resize session.
window.addEventListener("blur", pointerUpCallback);
} }
#resizerPointermove(name, event) { #resizerPointermove(name, event) {