Merge pull request #17344 from calixteman/issue17342

[Editor] Avoid to add a new ink editor when we aren't editing anymore
This commit is contained in:
calixteman 2023-11-27 16:53:48 +01:00 committed by GitHub
commit 4bf7ff2027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -152,10 +152,8 @@ class AnnotationEditorLayer {
} }
addInkEditorIfNeeded(isCommitting) { addInkEditorIfNeeded(isCommitting) {
if ( if (this.#uiManager.getMode() !== AnnotationEditorType.INK) {
!isCommitting && // We don't want to add an ink editor if we're not in ink mode!
this.#uiManager.getMode() !== AnnotationEditorType.INK
) {
return; return;
} }

View File

@ -1604,7 +1604,11 @@ class AnnotationEditorUIManager {
if (this.#activeEditor) { if (this.#activeEditor) {
// An editor is being edited so just commit it. // An editor is being edited so just commit it.
this.#activeEditor.commitOrRemove(); 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) { if (!this.hasSelection) {