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) {
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;
}

View File

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