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
21.63k stars 1.62k forks source link

CollectionView crashes on iOS and MacCatalyst when new items are added and it's in a view which isn't visible #22072

Open KeithBoynton opened 2 weeks ago

KeithBoynton commented 2 weeks ago

Description

If a CollectionView resides inside a view that is set to IsVisible="False" and the CollectionView is in a Grid with a row definition of * then it crashes on iOS and MacCatalyst when items are added to the collection. It works fine on Windows and Android.

Steps to Reproduce

  1. Clone the attached project
  2. Run the solution on iOS or MacCatalyst
  3. Wait a few seconds for some items to be added to the collection
  4. Observe the crash
  5. Run the solution in Windows or Android and wait a few seconds
  6. Observe it works
  7. On the MainPage.xaml set the IsVisible to True on View2
  8. Run the solution on iOS or MacCatalyst
  9. Wait a few seconds and observe it working
  10. Or... revert the IsVisible back to False and change the row definition in View2.xaml from * to Auto
  11. Run the solution on iOS or MacCatalyst and observe it working

Link to public reproduction project repository

https://bitbucket.org/KeithBoynton/view-not-visible-crash/src/master/

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

No workaround found

Relevant log output

No response

RoiChen001 commented 2 weeks ago

Can repro this issue at iOS platform on the latest 17.10 Preview 5(8.0.21).