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

[Bug] CollectionView Header cause delay to adding items. #7102

Closed
StevenGranados opened this issue Aug 8, 2019 · 3 comments · Fixed by #7199
Closed

[Bug] CollectionView Header cause delay to adding items. #7102

StevenGranados opened this issue Aug 8, 2019 · 3 comments · Fixed by #7199

Comments

@StevenGranados
Copy link
Contributor

StevenGranados commented Aug 8, 2019

Description

Adding a header to a collectionview in the latest prerelease causes items to be delayed.

Steps to Reproduce

  1. Click "add" button more than twice in attached repro.

Expected Behavior

In the repro if you click the add button it adds an "a" to the collectionview via an Observablecollection in a viewmodel. If i click it again I expect a "b".

Actual Behavior

I get an "a" the second time and a "b" the third time, as if delayed by one.

Basic Information

  • Version with issue: 4.2.0.673161-pre3
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:
    • Android: API 28

Reproduction Link

CollectionHeaderTest.zip

@StevenGranados StevenGranados added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 8, 2019
@jfversluis
Copy link
Member

Confirmed this is happening. The other thing that I'm noticing is that the second a is added to the top. And from there all the b's are also added before the initial a.

The problem goes away when you take out the header. Not tested with iOS yet since the implementation was just done today.

Watch a (very slow) gif representation of this here:
Untitled

@jfversluis jfversluis added a/collectionview p/Android and removed s/unverified New report that has yet to be verified labels Aug 8, 2019
@StevenGranados
Copy link
Contributor Author

I changed the repro so it does numbers instead, so the problem is clearer.

@jfversluis
Copy link
Member

Great, thank you!

In addition when I enable the selection mode and select an item, this also crashes because of the indices not being lined up correctly. Probably because of the header offset not taken into account.

/cc: @hartez

@hartez hartez self-assigned this Aug 8, 2019
samhouts pushed a commit that referenced this issue Aug 28, 2019
* Move all the header/footer adjustment to IItemsViewSource
fixes #7121
fixes #7102
partially implements #3172
fixes #7243

* Fix selection bugs introduced by header/footer on Android

* Implement grouping for CollectionView on Android

* Enable grouping tests for Android

* Naming and comment cleanup

* Update Xamarin.Forms.Platform.Android/CollectionView/ListSource.cs

Co-Authored-By: Gerald Versluis <gerald.versluis@microsoft.com>

* Update Xamarin.Forms.Platform.Android/CollectionView/ObservableGroupedSource.cs
felipebaltazar pushed a commit to felipebaltazar/Xamarin.Forms that referenced this issue Oct 16, 2019
* Move all the header/footer adjustment to IItemsViewSource
fixes xamarin#7121
fixes xamarin#7102
partially implements xamarin#3172
fixes xamarin#7243

* Fix selection bugs introduced by header/footer on Android

* Implement grouping for CollectionView on Android

* Enable grouping tests for Android

* Naming and comment cleanup

* Update Xamarin.Forms.Platform.Android/CollectionView/ListSource.cs

Co-Authored-By: Gerald Versluis <gerald.versluis@microsoft.com>

* Update Xamarin.Forms.Platform.Android/CollectionView/ObservableGroupedSource.cs
felipebaltazar pushed a commit to felipebaltazar/Xamarin.Forms that referenced this issue Oct 16, 2019
* Move all the header/footer adjustment to IItemsViewSource
fixes xamarin#7121
fixes xamarin#7102
partially implements xamarin#3172
fixes xamarin#7243

* Fix selection bugs introduced by header/footer on Android

* Implement grouping for CollectionView on Android

* Enable grouping tests for Android

* Naming and comment cleanup

* Update Xamarin.Forms.Platform.Android/CollectionView/ListSource.cs

Co-Authored-By: Gerald Versluis <gerald.versluis@microsoft.com>

* Update Xamarin.Forms.Platform.Android/CollectionView/ObservableGroupedSource.cs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants