This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] UWP: PopAsync causes a crash when called from a CollectionView.SelectionChanged event #11090
Labels
a/collectionview
blocker
Issue blocks next stable release. Prioritize fixing and reviewing this issue.
e/2 🕑
2
i/high
Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often
in-progress
This issue has an associated pull request that may resolve it!
p/UWP
t/bug 🐛
Milestone
Description
In latest releases of Xamarin.Forms, calling Navigation.PopAsync() from a CollectionView.SelectionChanged handler causes a crash in UWP projects.
Same code works fine with Android.
Steps to Reproduce
Expected Behavior
The user is navigated back to the main page.
Actual Behavior
Unhandled exception: "Object reference not set to an instance of an object."
at Xamarin.Forms.Platform.UWP.SelectableItemsViewRenderer
1.UpdateFormsSingleSelection() at Xamarin.Forms.Platform.UWP.SelectableItemsViewRenderer
1.UpdateFormsSelection()at Xamarin.Forms.Platform.UWP.SelectableItemsViewRenderer`1.NativeSelectionChanged(Object sender, SelectionChangedEventArgs args)
Basic Information
Reproduction Link
Sample project to demonstrate the problem:
App1.zip
Workaround
Instead of handling SelectionChanged, use a TapGestureRecognizer for the items in the CollectionView and call PopAsync() there.
The text was updated successfully, but these errors were encountered: