1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #17882 from calixteman/bug1889122

Use the string value of the field when calling the Format callback (bug 1889122)
This commit is contained in:
calixteman 2024-04-10 09:40:54 +02:00 committed by GitHub
commit 77ee914bd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 85 additions and 3 deletions

View file

@ -81,6 +81,15 @@ class EventDispatcher {
}
dispatch(baseEvent) {
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("TESTING") &&
baseEvent.name === "sandboxtripbegin"
) {
this._externalCall("send", [{ command: "sandboxTripEnd" }]);
return;
}
const id = baseEvent.id;
if (!(id in this._objects)) {
let event;
@ -233,7 +242,7 @@ class EventDispatcher {
// Run format actions if any for all the fields.
const event = (globalThis.event = new Event({}));
for (const source of Object.values(this._objects)) {
event.value = source.obj.value;
event.value = source.obj._getValue();
this.runActions(source, source, event, "Format");
}
}
@ -245,8 +254,7 @@ class EventDispatcher {
this.runCalculate(source, event);
const savedValue = source.obj._getValue();
event.value = source.obj.value;
const savedValue = (event.value = source.obj._getValue());
let formattedValue = null;
if (this.runActions(source, source, event, "Format")) {