diff --git a/web/toolbar.js b/web/toolbar.js index bf437a597..3bf9e3fa9 100644 --- a/web/toolbar.js +++ b/web/toolbar.js @@ -121,12 +121,17 @@ class Toolbar { this.#bindListeners(options); if (options.editorHighlightColorPicker) { - this.eventBus._on("annotationeditoruimanager", ({ uiManager }) => { - this.#setAnnotationEditorUIManager( - uiManager, - options.editorHighlightColorPicker - ); - }); + this.eventBus._on( + "annotationeditoruimanager", + ({ uiManager }) => { + this.#setAnnotationEditorUIManager( + uiManager, + options.editorHighlightColorPicker + ); + }, + // Once the color picker has been added, we don't want to add it again. + { once: true } + ); } this.reset();