Skip to content

Controlled checked value of checkbox not working when you want to uncheck again #6

Closed
@daphnesmit

Description

@daphnesmit

Dear jared!
I use your libs a lot since I like that they are fully accessible. So great work!

When making a bunch of controlled checkboxes I noticed that when I want to control the checked value from outside I need to press 2 times on the checkbox afterwards to uncheck the checkbox. I highly suspect that useSwitch is maybe not handling the toggling correctly. (we use a similiar thing called https://www.npmjs.com/package/use-binding)

I made codesandbox for this to demonstrate the issue.

https://codesandbox.io/s/admiring-aryabhata-1wy47?file=/src/App.tsx

If you press the button to check the checkbox and try to uncheck it using the checkbox itself you see you need to press to times.
Meanwhile I will try to see if I can find the issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions