diff --git a/src/display/editor/annotation_editor_layer.js b/src/display/editor/annotation_editor_layer.js index f45e6ef92..ccb10cbdc 100644 --- a/src/display/editor/annotation_editor_layer.js +++ b/src/display/editor/annotation_editor_layer.js @@ -152,10 +152,8 @@ class AnnotationEditorLayer { } addInkEditorIfNeeded(isCommitting) { - if ( - !isCommitting && - this.#uiManager.getMode() !== AnnotationEditorType.INK - ) { + if (this.#uiManager.getMode() !== AnnotationEditorType.INK) { + // We don't want to add an ink editor if we're not in ink mode! return; } diff --git a/src/display/editor/tools.js b/src/display/editor/tools.js index 89e898c8f..a3db74a0d 100644 --- a/src/display/editor/tools.js +++ b/src/display/editor/tools.js @@ -1604,7 +1604,11 @@ class AnnotationEditorUIManager { if (this.#activeEditor) { // An editor is being edited so just commit it. this.#activeEditor.commitOrRemove(); - return; + if (this.#mode !== AnnotationEditorType.NONE) { + // If the mode is NONE, we want to really unselect the editor, hence we + // mustn't return here. + return; + } } if (!this.hasSelection) {