Merge pull request #16714 from TaTo30/xfa-select-storage

XFA - Set storage values to select and option elements
This commit is contained in:
Jonas Jenwald 2023-07-21 20:09:32 +02:00 committed by GitHub
commit abb24f82fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}
}