-
Notifications
You must be signed in to change notification settings - Fork 47
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
x-bind:value
on a checkbox does not work
#1046
Comments
@gdebrauwer Sounds similar to #571 |
That issue talks about controlling the 'checked' flux attribute. It does not talk about setting the value of flux checkbox using |
@gdebrauwer I was more thinking about one comment, then Caleb's response:
then Caleb:
When looking at the
which indicates that the As my knowledge of the Flux js is limited, this is definitely an issue/answer that would benefit from @joshhanley 's insight. |
@gdebrauwer thanks for reporting! Yeah the issue is that Flux's javascript loads before Alpine's does, so what @jeffchown found is correct, that we assign a random value to the checkbox if there isn't one at the time Flux loads. The issue will be that it doesn't change if the value on the checkbox changes (aka when Alpine boots). |
The flux:checkbox instances are created within an alpinejs x-for, so should alpinejs not be loaded at that point 🤔 |
@gdebrauwer yeah, I just looked into this and I believe it's because Alpine doesn't set |
Flux version
v1.1.4
Livewire version
v3.5.19
What is the problem?
If you use a flux checkbox in an alpinejs' x-for loop and bind a dynamic value to every checkbox, then that value is not used and a random string value is used instead. That is not correct
Code snippets
How do you expect it to work?
Flux should use the value provided by the
x-bind:value
attributePlease confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: