mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #15093 from calixteman/issue15092
[JS] Update siblings when a field is updated after a calculation (#15092)
This commit is contained in:
commit
b5fea8ff14
5 changed files with 58 additions and 1 deletions
|
@ -1151,6 +1151,7 @@ class Doc extends PDFObject {
|
|||
field.obj.value = field.obj.defaultValue;
|
||||
this._send({
|
||||
id: field.obj._id,
|
||||
siblings: field.obj._siblings,
|
||||
value: field.obj.defaultValue,
|
||||
formattedValue: null,
|
||||
selRange: [0, 0],
|
||||
|
|
|
@ -163,6 +163,7 @@ class EventDispatcher {
|
|||
}
|
||||
source.obj._send({
|
||||
id: source.obj._id,
|
||||
siblings: source.obj._siblings,
|
||||
value,
|
||||
selRange: [selStart, selEnd],
|
||||
});
|
||||
|
@ -170,6 +171,7 @@ class EventDispatcher {
|
|||
} else if (!event.willCommit) {
|
||||
source.obj._send({
|
||||
id: source.obj._id,
|
||||
siblings: source.obj._siblings,
|
||||
value: savedChange.value,
|
||||
selRange: [savedChange.selStart, savedChange.selEnd],
|
||||
});
|
||||
|
@ -178,6 +180,7 @@ class EventDispatcher {
|
|||
// so just clear the field.
|
||||
source.obj._send({
|
||||
id: source.obj._id,
|
||||
siblings: source.obj._siblings,
|
||||
value: "",
|
||||
formattedValue: null,
|
||||
selRange: [0, 0],
|
||||
|
@ -193,6 +196,7 @@ class EventDispatcher {
|
|||
if (this.runActions(source, source, event, "Format")) {
|
||||
source.obj._send({
|
||||
id: source.obj._id,
|
||||
siblings: source.obj._siblings,
|
||||
formattedValue: event.value?.toString?.(),
|
||||
});
|
||||
}
|
||||
|
@ -215,6 +219,7 @@ class EventDispatcher {
|
|||
|
||||
source.obj._send({
|
||||
id: source.obj._id,
|
||||
siblings: source.obj._siblings,
|
||||
value: savedValue,
|
||||
formattedValue,
|
||||
});
|
||||
|
@ -223,6 +228,7 @@ class EventDispatcher {
|
|||
// The value is not valid.
|
||||
source.obj._send({
|
||||
id: source.obj._id,
|
||||
siblings: source.obj._siblings,
|
||||
value: "",
|
||||
formattedValue: null,
|
||||
selRange: [0, 0],
|
||||
|
@ -320,6 +326,7 @@ class EventDispatcher {
|
|||
|
||||
target.obj._send({
|
||||
id: target.obj._id,
|
||||
siblings: target.obj._siblings,
|
||||
value: savedValue,
|
||||
formattedValue,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue