(Repeater) Set other toggles to false when a toggle is set to true
What I am trying to do:
I'm trying to make a quiz inside a Wizard. In Step 2 I want to add the questions + options.
What I did:
I editted the CreateQuiz class and added a Wizard inside of it.
Added a couple repeaters for the questions and the options.
I select the
is_selected toggle of the first option.
I select the is_selected toggle of the second option.
Expected result:
first option = false
second option = true
My issue/the error:
Instead, the result is:
first option = true
second option = true
When I do it the other way around, so I select the second option first and then select the first, then it works as expected.
Code:
https://gist.github.com/Merdin/6c92e5e16ae8d2a2dc1f3a63bd78fbd2Solution:Jump to solution
Have you tried the
fixIndistinctState() method?
https://filamentphp.com/docs/4.x/forms/repeater#automatically-fixing-indistinct-state...2 Replies
Solution
Have you tried the
fixIndistinctState() method?
https://filamentphp.com/docs/4.x/forms/repeater#automatically-fixing-indistinct-statenot yet, will try it. thanks !
This works, thanks !