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
I tried fixing a checkbox using the hidden native input solution suggested in this issue. #341
This kind of works with with checkboxes and radio buttons.
I tried a similar solution with radio buttons. (Example 1.x) But there i ended up having to update the value with x-on:click event.
So my solution would be to do the same on a checkbox. But it seems like the <flux:checkbox /> component don't emit any events.
Sidenote
This Isn't directly related to this issue, but if this works i think that would solve my initial approach
Example 2.x have the limitation of setting a initial value from an Eloquent model. This might be a AlpineJS issue. Or it might be me, not knowing how to fix this.
@dennisfransen thanks for reporting! I'll be honest all of the code examples confused me haha and I wasn't exactly clear on what you were trying to achieve.
It seems to me that you want to ensure that a Flux checkbox and a standard checkbox are kept in sync, so that way you can use it in a normal form submit to get the checked value.
If that is the case, you can just use x-model on both of the checkboxes and it should work fine. See the code snippet below. I've removed the "hidden" class off the native checkbox for the moment, so you can see it in action.
Flux version
v2.0.1
Livewire version
v3.5.20
Tailwind version
v4.0.7
Browser and Operating System
Chrome on macOS
What is the problem?
I tried fixing a checkbox using the hidden native input solution suggested in this issue. #341
This kind of works with with checkboxes and radio buttons.
I tried a similar solution with radio buttons. (Example 1.x) But there i ended up having to update the value with
x-on:click
event.So my solution would be to do the same on a checkbox. But it seems like the
<flux:checkbox />
component don't emit any events.Sidenote
Code snippets
Example 1.1 - Does work
Example 1.2
Example 2.1 - Does work
Example: 2.2 - Doesn't work.
How do you expect it to work?
Please confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: