Skip to content

Commit

Permalink
XFA - Update select and option element attributes with the stored dat…
Browse files Browse the repository at this point in the history
…a and

removes the 'selected' attribute from option element if it's not actually selected.
  • Loading branch information
TaTo30 committed Jul 21, 2023
1 parent ee373b3 commit 51270bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/display/xfa_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ class XfaLayer {
break;
case "select":
if (storedData.value !== null) {
html.setAttribute("value", storedData.value);
for (const option of element.children) {
if (option.attributes.value === storedData.value) {
option.attributes.selected = true;
} else if (option.attributes.hasOwnProperty("selected")) {
delete option.attributes.selected;
}
}
}
Expand Down

0 comments on commit 51270bc

Please sign in to comment.