From c314d712999c88a84d5fa3331440f50794f9b435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Piellard?= Date: Mon, 18 Aug 2025 15:28:11 +0200 Subject: [PATCH] fix(examples): bindDropDown support all options IDs --- examples/widgets/bindDropDown.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/widgets/bindDropDown.js b/examples/widgets/bindDropDown.js index 2cda62ad2..1d8f2e5eb 100644 --- a/examples/widgets/bindDropDown.js +++ b/examples/widgets/bindDropDown.js @@ -33,10 +33,15 @@ export function bindDropDown(id, onChange) { /** @type {SetOptionsCallback} */ const setOptions = options => { - const items = options.map( - opt => ``, - ); - element.innerHTML = items.join('\n'); + element.innerHTML = ''; + + options.forEach(opt => { + const optElement = document.createElement('option'); + optElement.value = opt.id; + optElement.selected = opt.selected; + optElement.textContent = opt.name; + element.appendChild(optElement); + }); }; return [callback, element.value, element, setOptions]; -- GitLab