1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Handle the "switchannotationeditorparams" event in the editor-code (issue 18196)

The problem seems to be caused by the browser trying to "restore" editing input-elements, in the various toolbars, to their previous values when the tab is re-opened.

Hence the simplest solution appears to be to move the event handling into the editor-code, which is also less code overall, since the listener thus won't be registered early enough for the problem to appear.
This commit is contained in:
Jonas Jenwald 2024-08-13 15:23:23 +02:00
parent 82735537bf
commit 9e0c6ef476
3 changed files with 5 additions and 13 deletions

View file

@ -783,6 +783,11 @@ class AnnotationEditorUIManager {
signal,
});
eventBus._on("setpreference", this.onSetPreference.bind(this), { signal });
eventBus._on(
"switchannotationeditorparams",
evt => this.updateParams(evt.type, evt.value),
{ signal }
);
this.#addSelectionListener();
this.#addDragAndDropListeners();
this.#addKeyboardManager();