diff --git a/src/display/editor/editor.js b/src/display/editor/editor.js index 678d30534..c1066a86a 100644 --- a/src/display/editor/editor.js +++ b/src/display/editor/editor.js @@ -2230,7 +2230,7 @@ class AnnotationEditor { this.enterInEditMode(); this.parent.updateToolbar({ mode: this.constructor._editorType, - editId: this.id, + editId: this.uid, }); } diff --git a/src/display/editor/tools.js b/src/display/editor/tools.js index 5d5934611..910ded4ce 100644 --- a/src/display/editor/tools.js +++ b/src/display/editor/tools.js @@ -2253,7 +2253,7 @@ class AnnotationEditorUIManager { setSelected(editor) { this.updateToolbar({ mode: editor.mode, - editId: editor.id, + editId: editor.uid, }); this.#currentDrawingSession?.commitOrRemove(); diff --git a/test/integration/highlight_editor_spec.mjs b/test/integration/highlight_editor_spec.mjs index 730122921..c0a32108d 100644 --- a/test/integration/highlight_editor_spec.mjs +++ b/test/integration/highlight_editor_spec.mjs @@ -3024,4 +3024,43 @@ describe("Highlight Editor", () => { ); }); }); + + describe("All editors must be focusable", () => { + describe("bug1992868.pdf", () => { + let pages; + + beforeEach(async () => { + pages = await loadAndWait( + "bug1992868.pdf", + getAnnotationSelector("999R"), + "page-fit" + ); + }); + + afterEach(async () => { + await closePages(pages); + }); + + it("must check that the freetext annotation can be reached", async () => { + await Promise.all( + pages.map(async ([browserName, page]) => { + const modeChangedHandle = await waitForAnnotationModeChanged(page); + await page.click(getAnnotationSelector("997R"), { count: 2 }); + await awaitPromise(modeChangedHandle); + await page.waitForSelector("#highlightParamsToolbarContainer"); + + const editorSelector = getEditorSelector(0); + await page.waitForSelector(editorSelector); + await page.focus(editorSelector); + await waitForSelectedEditor(page, editorSelector); + + for (let i = 0; i < 4; i++) { + await page.keyboard.press("Tab", { delay: 100 }); + } + await waitForSelectedEditor(page, getEditorSelector(1)); + }) + ); + }); + }); + }); }); diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 45530519a..b59617d45 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -748,3 +748,4 @@ !comments.pdf !issue20319_1.pdf !issue20319_2.pdf +!bug1992868.pdf diff --git a/test/pdfs/bug1992868.pdf b/test/pdfs/bug1992868.pdf new file mode 100755 index 000000000..62fd271c4 Binary files /dev/null and b/test/pdfs/bug1992868.pdf differ