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

[Editor] When in non-editing mode, add a new editor only once the editing mode has switched

Switching to an editing mode can be asynchronous (e.g. if an editable annotation exists on a
visible page), so we must add a new editor only when the page rendering is done.
This commit is contained in:
Calixte Denizet 2024-07-15 21:04:47 +02:00
parent f9e3b6bcc4
commit 6dd75c0e62
5 changed files with 68 additions and 10 deletions

View file

@ -2311,11 +2311,11 @@ class PDFViewer {
const updater = () => {
this.#cleanupSwitchAnnotationEditorMode();
this.#annotationEditorMode = mode;
this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard);
eventBus.dispatch("annotationeditormodechanged", {
source: this,
mode,
});
this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard);
};
if (