-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
I previously created an issue (#32096 (comment)) where I had a problem with the toggled event of switches in a CollectionView. The resolution for that was 2 things: Use CollectionViewHandler2 and remove the use of Bindable properties in my data template. It seemed to fix the issue in my repo project.
However, when I applied those solutions to my real app, I discovered that there is still a problem with the toggled event. It seems to fire every time a switch comes into view and e.Value of the ToggledEventArgs does not seem to be correct. (I am using the ToggledEventArgs and the BindingContext of the sender to figure out if the switch was changed and process the save logic of the question.)
The difference between my repo app and my real app is the number of switches in the collection view and the number of options for each switch. My repo project only had 4 switches with 2 options each, which too simple. So I have updated my repo project to include a more realistic scenario -- 10 switches with 10 options each. Is this a side effect of virtualization of the CollectionView? I'm not quite sure how to get around this.
Steps to Reproduce
- Start the app. It will default to the Collection Views Tab. That is where you want to be.
- In the Facts category -> find the switch questions labeled "Facts Switch 10" thru "Facts Switch 14" -> Select "Switch Option 1" for all of them.
- Scroll down and find the switch questions labeled "Facts Switch 20" thru "Facts Switch 24" -> Select "Switch Option 2" for all of them.
- Quickly scroll back up and you'll see the first set of switch questions un-answering themselves. Look at the Facts category and you'll see the question answered count decreasing.
Screen.Recording.2025-12-04.at.3.24.02.PM.mov
Link to public reproduction project repository
https://github.com/pme442/CVIssueApp
Version with bug
10.0.10
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
any iOS version
Did you find any workaround?
No