diff --git a/faq/index.html b/faq/index.html index 168b827..215ee38 100644 --- a/faq/index.html +++ b/faq/index.html @@ -237,6 +237,13 @@ if (langBox) { applyLang(); }); } +// Accordion: only one answer open at a time +el('list').addEventListener('toggle', (ev) => { + const d = ev.target; + if (!d || d.tagName !== 'DETAILS' || !d.open) return; + el('list').querySelectorAll('details[open]').forEach(o => { if (o !== d) o.open = false; }); +}, true); + el('q').addEventListener('input', render); applyLang();