-
Notifications
You must be signed in to change notification settings - Fork 15
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
The same value is selected multiple times with setState() #11
Comments
try this
|
Unfortunately that didn't work. If there was a method like selectItem() in the controller, it would work for me. |
can you share the complete code ? |
are you expecting to do something like this? ` @OverRide class _TestState extends State {
} final status = ["A", "B", "C", "D", "E"]; var _selectedStatus = ["A", "B"]; List<MultiSelectCard> getStatusItem() {
} @OverRide |
Yeah. something like this. "A" and "B" are selected over and over each time setState() is triggered. Therefore, it is necessary to click more than once to deselect it. |
If you could share the entire code with that behavior, I would help you. and did you face that issue for the above code that I shared? |
Yes I am having the same issue for the above code. The only thing I changed in the code was I converted it from dynamic to string method. You can find the code in my project here. |
Same issue, pre selected items are selected twice onChange! |
I fixed this issue with this pull request, cheers! #16 |
When the page is loaded for the first time, I bring some values selected, as soon as I call setState() anywhere, the selected values are selected as many times as I use setState()
The code I used on the page is above.
The text was updated successfully, but these errors were encountered: