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>
|
||||
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>
|
||||
|
|
Loading…
Reference in a new issue