xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] CollectionView scrolls outside the bounded view after refresh and change header visibility -iOS only #13812

Open xhh2yqm opened 3 years ago

xhh2yqm commented 3 years ago

Description

In a collectionview with a header that sits inside a refreshview, changing header visibility while the data is refreshed, the collectionview scrolls pass the bounded area and the upper section of the collectionview items is hidden outside the bounds of the collectionview.

Steps to Reproduce

  1. load https://github.com/xhh2yqm/XamarinCollectionViewBug.git
  2. the header is hidden by default, refresh the collection view and tap "Button 2" to set the header to visible
  3. wait for the delay to finish and "Finished REFRESHING" is outputted Issue: the collectionview does not scroll back to start position of the items (with headers visible) same issue happens if you refresh from there and hit "Button 1"

Expected Behavior

collectionview and refreshview should scroll to the top of the first item or header (if visible)

Actual Behavior

collectionview scrolls outsides the bounded area

Basic Information

Environment

Show/Hide Visual Studio info ``` === Visual Studio Community 2019 for Mac === Version 8.8.9 (build 10) Installation UUID: 5ae0282c-9b8e-4c30-b55a-fcd6b7e40bbb GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638) Package version: 612000122 === Mono Framework MDK === Runtime: Mono 6.12.0.122 (2020-02/c621c35ffa0) (64-bit) Package version: 612000122 === Roslyn (Language Service) === 3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa === NuGet === Version: 5.8.0.6860 === .NET Core SDK === SDK: /usr/local/share/dotnet/sdk/5.0.103/Sdks SDK Versions: 5.0.103 5.0.102 5.0.101 3.1.406 3.1.405 3.1.404 MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks === .NET Core Runtime === Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 5.0.3 5.0.2 5.0.1 3.1.12 3.1.11 3.1.10 === .NET Core 3.1 SDK === SDK: 3.1.406 === Xamarin.Profiler === Version: 1.6.15.68 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler === Updater === Version: 11 === Apple Developer Tools === Xcode 12.4 (17801) Build 12D4e === Xamarin.Mac === Version: 7.4.0.4 (Visual Studio Community) Hash: 5a05865f6 Branch: xcode12.4 Build date: 2021-01-28 02:30:22-0500 === Xamarin.iOS === Version: 14.10.0.4 (Visual Studio Community) Hash: 5a05865f6 Branch: xcode12.4 Build date: 2021-01-28 02:30:23-0500 === Xamarin Designer === Version: 16.8.0.510 Hash: 44e3f3ce9 Branch: remotes/origin/d16-8 Build date: 2020-12-10 00:06:14 UTC === Xamarin.Android === Version: 11.1.0.26 (Visual Studio Community) Commit: xamarin-android/d16-8/a36ce73 Android SDK: /Users/xhh2yqm/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 8.1 (API level 27) SDK Tools Version: 26.1.1 SDK Platform Tools Version: 30.0.4 SDK Build Tools Version: 29.0.3 Build Information: Mono: 5e9cb6d Java.Interop: xamarin/java.interop/d16-8@79d9533 ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000 SQLite: xamarin/sqlite/3.32.1@1a3276b Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc === Microsoft OpenJDK for Mobile === Java SDK: /Users/xhh2yqm/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL === Android SDK Manager === Version: 16.8.0.32 Hash: 01a7774 Branch: remotes/origin/d16-8 Build date: 2021-01-14 00:34:58 UTC === Android Device Manager === Version: 16.8.0.46 Hash: 0a81419 Branch: remotes/origin/d16-8 Build date: 2021-01-14 00:35:22 UTC === Build Information === Release ID: 808090010 Git revision: 0061f975f58a5dba53e339f116371f4853edeb75 Build date: 2021-02-11 11:16:18-05 Build branch: release-8.8 Xamarin extensions: 0061f975f58a5dba53e339f116371f4853edeb75 === Operating System === Mac OS X 10.15.7 Darwin 19.6.0 Darwin Kernel Version 19.6.0 Mon Aug 31 22:12:52 PDT 2020 root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64 ```

Screenshots

https://user-images.githubusercontent.com/79297434/108539738-5d4aef00-72ae-11eb-91cb-d48fe1f975ee.mov

Reproduction Link

https://github.com/xhh2yqm/XamarinCollectionViewBug.git

PureWeen commented 3 years ago

@xhh2yqm can you delete the following directory from your repository?

https://github.com/xhh2yqm/XamarinCollectionViewBug/tree/master/.vs/XamarinBugs/xs

xhh2yqm commented 3 years ago

@xhh2yqm can you delete the following directory from your repository?

https://github.com/xhh2yqm/XamarinCollectionViewBug/tree/master/.vs/XamarinBugs/xs

hi @PureWeen i have removed the directory

Thanks

rachelkang commented 3 years ago

Hi, @xhh2yqm - just want to clarify before closing - is this resolved now?

xhh2yqm commented 3 years ago

Hi, @xhh2yqm - just want to clarify before closing - is this resolved now?

no it is still happening even on XF 5.0

rachelkang commented 3 years ago

Got it - I'm able to reproduce the issue on iOS on both XF 4.8 and 5.0.

thecuong064 commented 3 years ago

Is this something similar? https://github.com/xamarin/Xamarin.Forms/issues/8282 If yes then it might be fixed in https://github.com/xamarin/Xamarin.Forms/pull/13773

Hope this will be included in the next release of Xamarin Forms.

kensykora commented 2 years ago

Ran into this issue today. Currently trying to work around this by changing my design to not need a header.