Merge pull request #16474 from calixteman/issue16473

Reset the formatted value when after a text field has been modified
This commit is contained in:
calixteman 2023-05-26 10:43:40 +02:00 committed by GitHub
commit cbc4b20b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 0 deletions

View File

@ -1108,6 +1108,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
event.target.value,
"value"
);
elementData.formattedValue = null;
});
element.addEventListener("resetform", event => {

View File

@ -151,6 +151,31 @@ describe("Text widget", () => {
);
});
});
describe("issue16473.pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("issue16473.pdf", "[data-annotation-id='22R']");
});
afterAll(async () => {
await closePages(pages);
});
it("must reset a formatted value after a change", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.type(getSelector("22R"), "a");
await page.keyboard.press("Tab");
await page.waitForTimeout(10);
const text = await page.$eval(getSelector("22R"), el => el.value);
expect(text).withContext(`In ${browserName}`).toEqual("aHello World");
})
);
});
});
});
describe("Annotation and storage", () => {

View File

@ -594,3 +594,4 @@
!multiline.pdf
!bug1825002.pdf
!issue14755.pdf
!issue16473.pdf

BIN
test/pdfs/issue16473.pdf Executable file

Binary file not shown.