You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When binding to the checkbox with an already filled array as group object, the checkbox wont check it self, in svelte 5.
We are currently using an workaround because svelte has a bug with encapsulated checkboxes even in svelte 5.
if (checked===undefined) checked=_group.includes(value);
Because we bind the checked variable to the input and we check its value with use:action it will never be undefined, it is evaluated from undefined to false. but checked need to be undefined in order to load the data.
how to fix it
Because we can not unbind checked, but we can save the initial value of checked into a second const helper variable. before checked is bound.
Describe the bug
When binding to the checkbox with an already filled array as group object, the checkbox wont check it self, in svelte 5.
We are currently using an workaround because svelte has a bug with encapsulated checkboxes even in svelte 5.
Why is that?
This line is the issue:
flowbite-svelte/src/lib/forms/Checkbox.svelte
Line 22 in 4b1e19f
Because we bind the checked variable to the input and we check its value with use:action it will never be undefined, it is evaluated from undefined to false. but checked need to be undefined in order to load the data.
how to fix it
Because we can not unbind checked, but we can save the initial value of checked into a second const helper variable. before checked is bound.
the change that fixes the bug would be:
Reproduction
Flowbite version and System Info
The text was updated successfully, but these errors were encountered: