Fix checkbox jumping behaviour

This commit is contained in:
Pieter Vander Vennet 2024-02-20 23:22:13 +01:00
parent 5a957d56c7
commit ac90379499

View file

@ -6,10 +6,11 @@
*/
export let selected: UIEventSource<boolean>
let _c: boolean = selected.data ?? true
let id = `checkbox-input-${Math.round(Math.random()*100000000)}`
$: selected.set(_c)
</script>
<label class="no-image-background flex items-center gap-1">
<input bind:checked={_c} type="checkbox" />
<input bind:checked={_c} type="checkbox" {id} />
<slot />
</label>