From 18619ce4c968ecb1adec0818294826fdf85baa22 Mon Sep 17 00:00:00 2001 From: TaTo30 Date: Wed, 19 Jul 2023 19:18:40 -0600 Subject: [PATCH] [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. --- src/display/xfa_layer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/display/xfa_layer.js b/src/display/xfa_layer.js index 24f13a06f..7d21f7aa8 100644 --- a/src/display/xfa_layer.js +++ b/src/display/xfa_layer.js @@ -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; } } }