[XFA] Update select and option element attributes with the stored data and
removes the 'selected' attribute from option element if it's not actually selected.
This commit is contained in:
parent
ee373b313b
commit
18619ce4c9
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user