mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Use the string value of the field when calling the Format callback (bug 1889122)
This commit is contained in:
parent
25f6a0c139
commit
b643c0fcfb
6 changed files with 85 additions and 3 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue