diff --git a/ts/components/Collapsible.svelte b/ts/components/Collapsible.svelte index 0e8e3c0e2..c3bae9756 100644 --- a/ts/components/Collapsible.svelte +++ b/ts/components/Collapsible.svelte @@ -18,7 +18,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } $: duration = dynamicDuration(contentHeight); - const size = tweened(0); + const size = tweened(undefined); async function transition(collapse: boolean): Promise { if (collapse) { @@ -50,10 +50,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html let collapsibleElement: HTMLElement; - $: collapsed = $size === 0; + $: collapsed = ($size ?? 0) === 0; $: expanded = $size === 1; - $: height = $size * contentHeight; - $: transitioning = $size > 0 && !(collapsed || expanded); + $: height = ($size ?? 0) * contentHeight; + $: transitioning = ($size ?? 0) > 0 && !(collapsed || expanded); $: measuring = !(collapsed || transitioning || expanded); let hidden = collapsed;