dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.05k stars 1.73k forks source link

Nested CollectionView blocks selection in parent #17013

Open dmanning23 opened 1 year ago

dmanning23 commented 1 year ago

Description

If a CollectionView is nested inside another CollectionView, the user is unable to select an item in the parent view. The child view blocks input from the parent.

I was able to test this on Android, iOS, and MacCatalyst and was able to reproduce the bug on each platform.

This seems similar to https://github.com/dotnet/maui/issues/15016 except that bug report is referencing a Frame control instead of CollectionView.

Steps to Reproduce

  1. Create a CollectionView
  2. Set the SelectionMode="Single" and add a SelectionChanged event handler.
  3. Add a DataTemplate that includes a CollectionView
  4. Set the SelectionMode="None" of the datatemplate's CollectionView

I've repurposed one of the CollectionView examples from the maui-samples repo. When this project is run, it displays a list of monkeys with an Image and CollectionView displaying a list of data for each monkey. If the user taps the Image, the SelectionChanged handler is fired and a popup is displayed. If the user taps the list of data in the CollectionView, for example the monkey's name, the SelectionChangedHandler is not fired.

Link to public reproduction project repository

https://github.com/dmanning23/CollectionViewSelectionBug

Version with bug

7.0.92

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, macOS, I was not able test on other platforms

Affected platform versions

iOS 16.4, MacCatalyst, Android API30

Did you find any workaround?

No

Relevant log output

No response

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Android 13.0-API33 and iOS 16.4 .NET 8 with below Project: CollectionViewDemos.zip

Windows: Throw an exception: System.InvalidOperationException iOS: CollectionView