diff --git a/ts/components/Collapsible.svelte b/ts/components/Collapsible.svelte index ce85322ba..4efb2257d 100644 --- a/ts/components/Collapsible.svelte +++ b/ts/components/Collapsible.svelte @@ -11,7 +11,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export let toggleDisplay = false; export let animated = !document.body.classList.contains("reduced-motion"); - let collapsed = false; let contentHeight = 0; function dynamicDuration(height: number): number { @@ -56,6 +55,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $: height = $size * contentHeight; $: transitioning = $size > 0 && !(collapsed || expanded); $: measuring = !(collapsed || transitioning || expanded); + + let hidden = collapsed; + + $: { + /* await changes dependent on collapsed state */ + tick().then(() => (hidden = collapsed)); + }
@@ -80,7 +86,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html