I've found an interesting bug with adding items from a gallery to a new collection.
I have a gallery list with a toggle on each item. When the toggle is changed it will add or remove ThisItem to a new collection. I've used both OnChange with a Switch, and also Adding/Removing to the collection using OnCheck/OnUncheck.
The bug adds the first item in the list if it is toggled when the search input is reset. If the first item is not selected the behavior is as expected.
First Item in Gallery is selected:
https://gfycat.com/AgonizingDefinitiveCommabutterfly
First item in Gallery is selected, search is reset multiple times:
https://gfycat.com/HighConventionalIndianrhinoceros
First item in Gallery is not selected:
https://gfycat.com/PassionateFrailLeafcutterant
Is there a way I can achieve the desired result without this bug? It could work if there was a loop placed on a button which would go through all items in the gallery and collect the ones that have the toggle set to true, but as far as I know there is not a For loop and the Gallery.AllItems object nests all of the objects such as the labels in the array.

Report
All responses (
Answers (