Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionView DisconnectHandler SelectionMode=Multiple Windows exception #23649

Closed
siem300 opened this issue Jul 17, 2024 · 2 comments · Fixed by #23726
Closed

CollectionView DisconnectHandler SelectionMode=Multiple Windows exception #23649

siem300 opened this issue Jul 17, 2024 · 2 comments · Fixed by #23726
Assignees
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView fixed-in-8.0.80 fixed-in-9.0.0-preview.7.24407.4 p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@siem300
Copy link

siem300 commented Jul 17, 2024

Description

In our apps we have an issue with the DisconnectHandler of the CollectionView. When we call the DisconnectHandler method for the CollectionView when the SelectionMode is set to Multiple the apps throw an exception.

Exception:
{"PlatformView cannot be null here"}

The handler changes the selecteditems while it is being disconnected and this results in a change where the PlatformView is needed.

This issue only occurs on Windows. Android and iOS work as intended.

Steps to Reproduce

  1. Start the attached reproduction project
  2. Select either 'Navigate as modal' or 'Navigate'
  3. Select one or more of the test strings
  4. Select the 'Navigate back' button
  5. App throws an exception but doesn't crash (in our case other code doesn't get executed because of this)

Link to public reproduction project repository

https://github.com/siem300/Maui-CollectionViewDisconnectHandlerWindows

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

A possible workaround is setting the selectionmode to none. The problem with this is that our page doesn't know which controls it is disconnecting so we have to type check them.

Relevant log output

at Microsoft.Maui.Handlers.ViewHandler`2.get_PlatformView()
   at Microsoft.Maui.Controls.Handlers.Items.ItemsViewHandler`1.get_ListViewBase()
   at Microsoft.Maui.Controls.Handlers.Items.SelectableItemsViewHandler`1.UpdateVirtualSelection()
   at Microsoft.Maui.Controls.Handlers.Items.SelectableItemsViewHandler`1.PlatformSelectionChanged(Object sender, SelectionChangedEventArgs args)
   at WinRT._EventSource_global__Microsoft_UI_Xaml_Controls_SelectionChangedEventHandler.EventState.<GetEventInvoke>b__1_0(Object sender, SelectionChangedEventArgs e)
   at ABI.Microsoft.UI.Xaml.Controls.SelectionChangedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)
--- End of stack trace from previous location ---
@siem300 siem300 added the t/bug Something isn't working label Jul 17, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@siem300 siem300 changed the title CollectionView DisconnectHandler SelectionMode=Multiple Windows Crash CollectionView DisconnectHandler SelectionMode=Multiple Windows exception Jul 17, 2024
@RoiChen001 RoiChen001 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 18, 2024
@RoiChen001
Copy link

RoiChen001 commented Jul 18, 2024

I can repro this issue at Windows platform on the latest 17.11.0 Preview 4.0 (8.0.70&8.0.60&8.0.40).

@PureWeen PureWeen added p/2 Work that is important, but is currently not scheduled for release area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Jul 18, 2024
@PureWeen PureWeen added this to the .NET 8 SR9 milestone Jul 18, 2024
@PureWeen PureWeen added p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint and removed p/2 Work that is important, but is currently not scheduled for release labels Jul 18, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Jul 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView fixed-in-8.0.80 fixed-in-9.0.0-preview.7.24407.4 p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants