Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
Robonau authored and Robonau committed Nov 21, 2024
1 parent 133c464 commit f158a86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/components/switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
// Provide a semantic label.
label?: string;
children?: import('svelte').Snippet;
onchange?: (e: boolean) => void;
onkeydown?: (
e: KeyboardEvent & {
currentTarget: EventTarget & HTMLDivElement;
Expand All @@ -55,6 +56,7 @@
labelClass = 'ml-3',
label = '',
class: clasNames = '',
onchange = () => {},
onkeydown = () => {},
children,
...rest
Expand Down Expand Up @@ -136,6 +138,9 @@
bind:checked
{name}
{...rest}
onchange={(e) => {
onchange(checked ?? false);
}}
disabled={rest.disabled as boolean | undefined | null}
/>
<!-- Label -->
Expand Down

0 comments on commit f158a86

Please sign in to comment.