Merge pull request #16474 from calixteman/issue16473
Reset the formatted value when after a text field has been modified
This commit is contained in:
commit
cbc4b20b12
@ -1108,6 +1108,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||||||
event.target.value,
|
event.target.value,
|
||||||
"value"
|
"value"
|
||||||
);
|
);
|
||||||
|
elementData.formattedValue = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
element.addEventListener("resetform", event => {
|
element.addEventListener("resetform", event => {
|
||||||
|
@ -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", () => {
|
describe("Annotation and storage", () => {
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -594,3 +594,4 @@
|
|||||||
!multiline.pdf
|
!multiline.pdf
|
||||||
!bug1825002.pdf
|
!bug1825002.pdf
|
||||||
!issue14755.pdf
|
!issue14755.pdf
|
||||||
|
!issue16473.pdf
|
||||||
|
BIN
test/pdfs/issue16473.pdf
Executable file
BIN
test/pdfs/issue16473.pdf
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user