saadeghi/daisyui

bug: Checkbox input not responsive if checked value is "true"

wackazong opened this issue · 3 comments

What version of daisyUI are you using?

v4.7.3

Which browsers are you seeing the problem on?

Chrome

Reproduction URL

https://play.tailwindcss.com/dbreoATM6k

Describe your issue

See Tailwind play. I would expect all toggles to work.

Thank you @wackazong for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

I tested your case.

According to source code, in this file: https://github.com/saadeghi/daisyui/blob/master/src/components/styled/toggle.css
line 24.

&[checked="true"]
This selector will always select the broken one.

I copy the case code in playground to reproduce in local and reomove the selector, it works well.
Like this:
image

I agree. If that selector is removed then the toggle behaves as expected in all cases. As a workaround I remove this selector now manually in my tailwind setup.