[JS] Send a Validate action on change on Choice widget
This commit is contained in:
parent
255e982542
commit
dca54c8f8a
@ -1765,8 +1765,9 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
|
||||
["mouseleave", "Mouse Exit"],
|
||||
["mouseup", "Mouse Up"],
|
||||
["input", "Action"],
|
||||
["input", "Validate"],
|
||||
],
|
||||
event => event.target.checked
|
||||
event => event.target.value
|
||||
);
|
||||
} else {
|
||||
selectElement.addEventListener("input", function (event) {
|
||||
|
@ -1854,4 +1854,43 @@ describe("Interaction", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("in issue16067.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("issue16067.pdf", getSelector("6R"));
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check that a field has the correct value when a choice is changed", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForFunction(
|
||||
"window.PDFViewerApplication.scriptingReady === true"
|
||||
);
|
||||
|
||||
let text = await page.$eval(getSelector("44R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("");
|
||||
|
||||
await page.select(getSelector("6R"), "Yes");
|
||||
await page.waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("44R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("Yes");
|
||||
|
||||
await clearInput(page, getSelector("44R"));
|
||||
|
||||
await page.select(getSelector("6R"), "No");
|
||||
await page.waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("44R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("No");
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -575,3 +575,4 @@
|
||||
!issue16021.pdf
|
||||
!bug1770750.pdf
|
||||
!issue16063.pdf
|
||||
!issue16067.pdf
|
||||
|
BIN
test/pdfs/issue16067.pdf
Executable file
BIN
test/pdfs/issue16067.pdf
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user