From 6e8709d044591226a7dd6ded9f61be4e3d433632 Mon Sep 17 00:00:00 2001 From: Dario Vladovic Date: Sun, 16 Feb 2020 06:26:41 +0100 Subject: [PATCH] Fix panel state toggling --- micro_files/plugin-search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/micro_files/plugin-search.js b/micro_files/plugin-search.js index ff0e90b..d58ed36 100644 --- a/micro_files/plugin-search.js +++ b/micro_files/plugin-search.js @@ -151,7 +151,10 @@ function toggleElement (el, state) { function togglePanelState (el, { expand = false }) { const tabpanel = el.querySelector('[role="tabpanel"]'); - tabpanel && tabpanel.classList.toggle('in', expand); + if (!tabpanel) return; + tabpanel.classList.toggle('in', expand); + if (expand) tabpanel.style.height = ''; + tabpanel.setAttribute('aria-expanded', expand); } async function fetchJson (url) {