Conditional checkbox options #838
mohdaftab
started this conversation in
4. General
Replies: 1 comment 6 replies
-
Delaying livewire for 50 seconds won't fix the issue. It will still trigger a refresh after 50s and you'll probably experience the same bug. If all your checkboxes are managed server side, you might as well reset the other checkboxes on the server using the updated hook. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am working on a roles based system for an admin account which selects user role from select option.
I have a few roles in the list which can be multi selected and if any of them is selected I need all other roles which are not allowed for multiple roles to be unchecked and if there is a non-multiple role selected then I need all others to be unchecked.
I managed to do this using Javascript but as soon as livewire validation triggers on other fields all the checkboxes which I clicked on gets checked.
I got this fixed using debounce.50000ms on role select option but now the issue is I need some roles to emit a function to load users list in a dropdown with selected role but due to debounce it doesn't work until 50 seconds are gone. Please let me know what is the best way to work this around.
I am a beginner Livewire user and AlpineJS as well.
I also tried AlpineJS and tried to call a javascript function but it behaved the same way.
Please help me find the solution for this issue.
Thank you
This is the javascript I am using
`$(document).on("change", "input.user-role", function (e) {
});`
And this is my blade template:
`
Add User Form
Beta Was this translation helpful? Give feedback.
All reactions