fix: prevent Collapsible onChange from firing on initial mount

This commit is contained in:
maco 2026-05-30 23:12:09 +02:00
parent 4923920bf1
commit 7186bec195

View file

@ -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();
</script>