diff --git a/packages/lib/package.json b/packages/lib/package.json index 101d5bc8..e5679790 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "flowbite-qwik", - "version": "0.36.1", + "version": "0.36.2", "description": "Unofficial Qwik components built for Flowbite and Tailwind CSS", "keywords": [ "design-system", diff --git a/packages/lib/src/components/Checkbox/Checkbox.tsx b/packages/lib/src/components/Checkbox/Checkbox.tsx index 321af18d..c4dd2307 100644 --- a/packages/lib/src/components/Checkbox/Checkbox.tsx +++ b/packages/lib/src/components/Checkbox/Checkbox.tsx @@ -1,4 +1,4 @@ -import { QRL, Slot, component$, useComputed$, PropsOf, JSXChildren } from '@builder.io/qwik' +import { QRL, Slot, component$, useComputed$, PropsOf, JSXChildren, useSignal, useTask$ } from '@builder.io/qwik' import clsx from 'clsx' import { useCheckboxClasses } from './composables/use-checkbox-classes' import { twMerge } from 'tailwind-merge' @@ -15,19 +15,19 @@ export const Checkbox = component$(({ color, class: classNames, o const internalColor = useComputed$(() => color) const { checkboxClasses, labelClasses } = useCheckboxClasses(internalColor) + const checked = useSignal(Boolean(props.checked)) + useTask$(({ track }) => { + const innerChecked = track(() => props.checked) + checked.value = Boolean(innerChecked) + }) + return (