Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox bind:group no longer working with stores. #1391

Open
randomiser opened this issue Jul 16, 2024 · 3 comments
Open

Checkbox bind:group no longer working with stores. #1391

randomiser opened this issue Jul 16, 2024 · 3 comments

Comments

@randomiser
Copy link

Describe the bug

The Checkbox component no longer seems to bind correctly with writable stores.

In the example provided clicking on the Checkbox to toggle on/off doesn't update the contents of the $store.ids. Whereas the default HTML version works as expected.

Reproduction

const store = writable({ids: []});

Store: {JSON.stringify($store, null, 2)}

Doesn't update store:

<Checkbox name="ids" value={1} bind:group={$store.ids} /> FLOWBITE

Updates store:

<input name="ids" type="checkbox" value={1} bind:group={$store.ids} /> HTML

Flowbite version and System Info

System:
    OS: macOS 14.5
    CPU: (8) x64 Apple M1
    Memory: 22.26 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.2.0 - /usr/local/opt/node@20/bin/node
    npm: 10.7.0 - /usr/local/opt/node@20/bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5
  npmPackages:
    @sveltejs/kit: ^2.3.0 => 2.5.18 
    flowbite-svelte: ^0.46.0 => 0.46.15 
    svelte: ^4.0.0 => 4.2.18 
    vite: ^5.0.0 => 5.3.3
@alistair-white-fortesium
Copy link

alistair-white-fortesium commented Aug 9, 2024

From looking at the source code I think the groups binding is just generally broken, not just for stores.
I don't quite understand - this checkin here completely changed how the groups binding works, and in my opinion for the worse?
47a90d2

Its now expecting to pass in an array of choices, which just seems much more limiting? What was wrong with the implementation before (other than the general hacky nature of it but its a svelte bug anyway).

@mattdeboard
Copy link
Contributor

#1398 seems related

@herronelou
Copy link
Contributor

I have the exact same issue, updated flowbite-svelte yesterday and whole website exploded, none of my filters or checkboxes work anymore, this is a major problem as far as I'm concerned. @shinokada

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants