diff --git a/src/display/editor/annotation_editor_layer.js b/src/display/editor/annotation_editor_layer.js index 5a14760d2..98e0038e2 100644 --- a/src/display/editor/annotation_editor_layer.js +++ b/src/display/editor/annotation_editor_layer.js @@ -113,7 +113,11 @@ class AnnotationEditorLayer { * @param {MouseEvent} event */ mouseover(event) { - if (event.target === this.div && event.buttons === 0) { + if ( + event.target === this.div && + event.buttons === 0 && + !this.#uiManager.hasActive() + ) { // The div is the target so there is no ink editor, hence we can // create a new one. // event.buttons === 0 is here to avoid adding a new ink editor diff --git a/src/display/editor/tools.js b/src/display/editor/tools.js index 731f98a78..bd0f90922 100644 --- a/src/display/editor/tools.js +++ b/src/display/editor/tools.js @@ -570,6 +570,14 @@ class AnnotationEditorUIManager { return this.#activeEditor; } + /** + * Check if there is an active editor. + * @returns {boolean} + */ + hasActive() { + return this.#activeEditor !== null; + } + /** * Get the current editor mode. * @returns {number}