diff --git a/src/display/editor/annotation_editor_layer.js b/src/display/editor/annotation_editor_layer.js index daf48342e..3204b2dbb 100644 --- a/src/display/editor/annotation_editor_layer.js +++ b/src/display/editor/annotation_editor_layer.js @@ -69,9 +69,9 @@ class AnnotationEditorLayer { AnnotationEditorLayer._initialized = true; FreeTextEditor.initialize(options.l10n); InkEditor.initialize(options.l10n); - - options.uiManager.registerEditorTypes([FreeTextEditor, InkEditor]); } + options.uiManager.registerEditorTypes([FreeTextEditor, InkEditor]); + this.#uiManager = options.uiManager; this.annotationStorage = options.annotationStorage; this.pageIndex = options.pageIndex; diff --git a/src/display/editor/tools.js b/src/display/editor/tools.js index 884205a4b..542784d1e 100644 --- a/src/display/editor/tools.js +++ b/src/display/editor/tools.js @@ -637,6 +637,9 @@ class AnnotationEditorUIManager { } registerEditorTypes(types) { + if (this.#editorTypes) { + return; + } this.#editorTypes = types; for (const editorType of this.#editorTypes) { this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);