Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [ios] CollectionView crashes on iOS when adding new groups (repro included) Also slows down when SectionHeadersPinToVisibleBounds is true #15161

Open
softlion opened this issue Feb 16, 2022 · 3 comments
Labels

Comments

@softlion
Copy link
Contributor

softlion commented Feb 16, 2022

Description

Steps to Reproduce

Repro: https://github.com/vapolia/ReproCollectionViewGroupCrash

  1. Add a CollectionView with IsGrouped set to true
  2. Add a datasource containing 1 group (groups are an ObservableCollection, items in groups are in an ObservableCollection too)
  3. Init the UI, then after 1 second, remove the 1st group, then add 2 new groups.

Expected Behavior

2 groups displayed in the collection vuew

Actual Behavior

crash

Basic Information

  • Version with issue: all
  • Last known good version: none
  • Platform Target Frameworks:
    • iOS:

Reproduction Link

https://github.com/vapolia/ReproCollectionViewGroupCrash

Workaround

Add Task.Delay(1) after each unit change involving groups.

additional info:

Repro is easy:

    public class MyCollectionViewRenderer : CollectionViewRenderer
    {
        //Slow down scroll hard then crash !!
         protected override ItemsViewLayout SelectLayout()
         {
             var layout = base.SelectLayout();
             if (layout is UICollectionViewFlowLayout flow)
                 flow.SectionHeadersPinToVisibleBounds = true;
             return layout;
         }
    }
@softlion softlion added s/unverified New report that has yet to be verified t/bug 🐛 labels Feb 16, 2022
@softlion softlion changed the title [Bug] CollectionView crashes on iOS when adding new groups (repro included) [Bug] [ios] CollectionView crashes on iOS when adding new groups (repro included) Feb 16, 2022
@softlion softlion changed the title [Bug] [ios] CollectionView crashes on iOS when adding new groups (repro included) [Bug] [ios] CollectionView crashes on iOS when adding new groups (repro included) Also slows down when SectionHeadersPinToVisibleBounds is true Feb 17, 2022
@tarunagrawal1990
Copy link

Any workaround for this issue, till the time new version get released.

@softlion
Copy link
Contributor Author

Any workaround for this issue, till the time new version get released.

Read workaround in issue :)

@softlion
Copy link
Contributor Author

softlion commented May 3, 2022

Note there is no workaround for the slowness.

The slowness appears whenever the collectionview's control height changes from its top. Repro is simple: add a vertical full screen stacklayout, a label and a collectionview that fills the remaining space. Set IsVisible to false on the label by default. Then trigger IsVisible to true on the label 5 secondes after the UI is displayed.

The collectionview scroll will becore VERY VERY slow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants