mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
XFA - Fix error when creating a new data node
- fix for issue #13556; - value in a field can be empty.
This commit is contained in:
parent
a4e8f3bdee
commit
150fa3d96e
4 changed files with 19 additions and 4 deletions
|
@ -313,7 +313,7 @@ function createDataNode(root, container, expr) {
|
|||
}
|
||||
root = child;
|
||||
} else {
|
||||
parsed[i].index = children.length - index;
|
||||
parsed[i].index = index - children.length;
|
||||
return createNodes(root, parsed.slice(i));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2396,9 +2396,15 @@ class Field extends XFAObject {
|
|||
if (this.ui.imageEdit) {
|
||||
ui.children.push(this.value[$toHTML]().html);
|
||||
} else if (!this.ui.button) {
|
||||
const value = this.value.exData
|
||||
? this.value.exData[$text]()
|
||||
: this.value[$toHTML]().html.value;
|
||||
let value = "";
|
||||
if (this.value.exData) {
|
||||
value = this.value.exData[$text]();
|
||||
} else {
|
||||
const htmlValue = this.value[$toHTML]().html;
|
||||
if (htmlValue !== null) {
|
||||
value = htmlValue.value;
|
||||
}
|
||||
}
|
||||
if (value) {
|
||||
if (ui.children[0].name === "textarea") {
|
||||
ui.children[0].attributes.textContent = value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue