Fix checkbox jumping behaviour
This commit is contained in:
parent
5a957d56c7
commit
ac90379499
1 changed files with 2 additions and 1 deletions
|
@ -6,10 +6,11 @@
|
||||||
*/
|
*/
|
||||||
export let selected: UIEventSource<boolean>
|
export let selected: UIEventSource<boolean>
|
||||||
let _c: boolean = selected.data ?? true
|
let _c: boolean = selected.data ?? true
|
||||||
|
let id = `checkbox-input-${Math.round(Math.random()*100000000)}`
|
||||||
$: selected.set(_c)
|
$: selected.set(_c)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<label class="no-image-background flex items-center gap-1">
|
<label class="no-image-background flex items-center gap-1">
|
||||||
<input bind:checked={_c} type="checkbox" />
|
<input bind:checked={_c} type="checkbox" {id} />
|
||||||
<slot />
|
<slot />
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in a new issue