checkbox: no default value
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user