Skip to content

CollectionView DataTemplate with Switch: Toggled event is called in infinite loop causing app to crash. #32096

@pme442

Description

@pme442

Description

I am creating this issue in regard to an existing issue that has recently been closed but NOT fixed. #29556 (comment)
As you can see, it has also been verified by two other people.
I have upgraded to the latest version (9.0.110 SR11) but the issue is still present.
I am unable to release my app to production until this is fixed.

Steps to Reproduce

In the Collection Views tab -> select the 2nd category (Favorites) -> find the switch question labeled "Favorites Switch 1 Yes or No" -> Answer "Yes".

How it should work:

If you answer "Yes": The questions should reload and SHOW the second switch question labeled "Favorites Switch 2 Yes or No".
If you answer "No" or unanswer the question: The questions should reload and HIDE the second switch question labeled "Favorites Switch 2 Yes or No".
How it is working:
When you answer "Yes", the questions are reloaded and the second switch question is shown, but the screen flashes and the OnSwitchToggled event (see Controls/QuestionSwitchEntry.xaml.cs) gets called in an infinite loop where it keeps updating the "AnsweredBy" text until the whole app crashes.

Note: If you go to the List Views tab and try this, it works perfectly.

(https://github.com/user-attachments/assets/12f7d13a-61f6-4628-a576-e3613099c3c9)

Link to public reproduction project repository

https://github.com/pme442/CVIssueApp

Version with bug

9.0.110 SR11

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

Any IOS version. I've seen it in 15, 16, 17, 18.

Did you find any workaround?

No

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions