Merge pull request #15598 from calixteman/15597
[Annotation] Replace use of id by data-element-id to have the correct id
This commit is contained in:
commit
f3949ba69d
@ -551,7 +551,8 @@ class AnnotationElement {
|
||||
// Fallback to a regular DOM lookup, to ensure that the standalone
|
||||
// viewer components won't break.
|
||||
for (const domElement of document.getElementsByName(name)) {
|
||||
const { id, exportValue } = domElement;
|
||||
const { exportValue } = domElement;
|
||||
const id = domElement.getAttribute("data-element-id");
|
||||
if (id === skipId) {
|
||||
continue;
|
||||
}
|
||||
|
@ -95,6 +95,31 @@ describe("Checkbox annotation", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("issue15597.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("issue15597.pdf", "[data-annotation-id='7R']");
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check the checkbox", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
const selector = "[data-annotation-id='7R']";
|
||||
await page.click(selector);
|
||||
await page.waitForFunction(
|
||||
`document.querySelector("${selector} > :first-child").checked`
|
||||
);
|
||||
expect(true).withContext(`In ${browserName}`).toEqual(true);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Text widget", () => {
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -547,3 +547,4 @@
|
||||
!bug1782564.pdf
|
||||
!issue15340.pdf
|
||||
!bug1795263.pdf
|
||||
!issue15597.pdf
|
||||
|
BIN
test/pdfs/issue15597.pdf
Executable file
BIN
test/pdfs/issue15597.pdf
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user