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

[Editor] Don't add an already added editor (bug 1890367)

This commit is contained in:
Calixte Denizet 2024-04-08 18:07:34 +02:00
parent 5adad89eb3
commit 976ee96aa8
2 changed files with 44 additions and 0 deletions

View file

@ -481,6 +481,9 @@ class AnnotationEditorLayer {
* @param {AnnotationEditor} editor
*/
add(editor) {
if (editor.parent === this && editor.isAttachedToDOM) {
return;
}
this.changeParent(editor);
this.#uiManager.addEditor(editor);
this.attach(editor);