Skip to content

Commit 4739a58

Browse files
committed
fix(pdf-server): capture all selected options on <select multiple>
target.value on a multiselect is only the first option; join selectedOptions so the save path gets the full set.
1 parent d7a768e commit 4739a58

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

examples/pdf-server/src/mcp-app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3507,6 +3507,10 @@ formLayerEl.addEventListener("input", (e) => {
35073507
if (!target.checked) return; // unchecking siblings — ignore
35083508
const wid = target.getAttribute("data-element-id");
35093509
value = (wid && radioButtonValues.get(wid)) ?? target.value;
3510+
} else if (target instanceof HTMLSelectElement && target.multiple) {
3511+
// .value on a <select multiple> is only the first option; join them all
3512+
// so save can select() the full set on a PDFOptionList.
3513+
value = Array.from(target.selectedOptions, (o) => o.value).join(",");
35103514
} else {
35113515
value = target.value;
35123516
}

0 commit comments

Comments
 (0)