diff --git a/src/lib/components/common/Collapsible.svelte b/src/lib/components/common/Collapsible.svelte index a43727bb7e..d4207c65e9 100644 --- a/src/lib/components/common/Collapsible.svelte +++ b/src/lib/components/common/Collapsible.svelte @@ -2,7 +2,7 @@ import { decode } from 'html-entities'; import { v4 as uuidv4 } from 'uuid'; - import { getContext } from 'svelte'; + import { getContext, onMount } from 'svelte'; const i18n = getContext('i18n'); import dayjs from '$lib/dayjs'; @@ -55,7 +55,9 @@ export let onChange: Function = () => {}; - $: onChange(open); + let _mounted = false; + onMount(() => { _mounted = true; }); + $: if (_mounted) onChange(open); const collapsibleId = uuidv4();