checkbox: no default value

This commit is contained in:
Elijah Duffy
2025-08-11 17:11:48 -07:00
parent 0e188db829
commit 4e10c79e2b

View File

@@ -1,5 +1,5 @@
<script lang="ts" module>
export type CheckboxState = 'indeterminate' | boolean | undefined;
export type CheckboxState = 'indeterminate' | boolean;
</script>
<script lang="ts">
@@ -22,7 +22,7 @@
let {
name,
required = false,
value = $bindable(false),
value = $bindable(),
color = 'contrast',
class: classValue,
children,
@@ -63,7 +63,7 @@
!valid && 'border-sui-accent-400 border'
]}
onclick={() => {
if (value === false || value === 'indeterminate') {
if (value === false || value === undefined || value === 'indeterminate') {
value = true;
} else {
value = false;