[Editor] Make sure all editors are focusable with the keyboard (bug 1992868)

This commit is contained in:
Calixte Denizet 2025-10-07 14:40:06 +02:00
parent 1df2ee68b7
commit 5c28346abc
5 changed files with 42 additions and 2 deletions

View File

@ -2230,7 +2230,7 @@ class AnnotationEditor {
this.enterInEditMode(); this.enterInEditMode();
this.parent.updateToolbar({ this.parent.updateToolbar({
mode: this.constructor._editorType, mode: this.constructor._editorType,
editId: this.id, editId: this.uid,
}); });
} }

View File

@ -2253,7 +2253,7 @@ class AnnotationEditorUIManager {
setSelected(editor) { setSelected(editor) {
this.updateToolbar({ this.updateToolbar({
mode: editor.mode, mode: editor.mode,
editId: editor.id, editId: editor.uid,
}); });
this.#currentDrawingSession?.commitOrRemove(); this.#currentDrawingSession?.commitOrRemove();

View File

@ -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));
})
);
});
});
});
}); });

View File

@ -748,3 +748,4 @@
!comments.pdf !comments.pdf
!issue20319_1.pdf !issue20319_1.pdf
!issue20319_2.pdf !issue20319_2.pdf
!bug1992868.pdf

BIN
test/pdfs/bug1992868.pdf Executable file

Binary file not shown.