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

[Bug] CollectionView items do not resize properly when item template is grid (Regression from 4.7 to 4.8) (Android & iOS) #12175

Closed
lafritay opened this issue Sep 18, 2020 · 6 comments
Assignees
Labels
4.8.0 regression on 4.8.0 a/collectionview e/6 🕕 6 i/regression in-progress This issue has an associated pull request that may resolve it! p/Android p/iOS 🍎 t/bug 🐛

Comments

@lafritay
Copy link

lafritay commented Sep 18, 2020

Description / Steps to Reproduce

Scenario: In a CollectionView draw a list of items that is a grid with two columns such that:

  1. The first column contains a StackLayout with two labels and the first label gets updated after the initial draw, possibly increasing it's length.
  2. The second column contains any element.

See the attached project for an example. Launch the app. Click on Browse. Wait about 5 seconds for the view to update.

Expected Behavior

When the update occurs, the items in the CollectionView resize so all of the content is shown. This works on 4.7.0.1351:

image

Actual Behavior

On 4.8.0.1451, the items change size but they get the wrong size which ends up with elements being cut off:

image

Notice how the item description line is cut off or hidden in a few of the rows. Unlike most other CollectionView item resize bugs, this happens on BOTH Android and iOS.

Basic Information

  • Version with issue: 4.8.0.1451
  • Last known good version: 4.7.0.1351
  • IDE: Visual Studio
  • Platform Target Frameworks:
    • iOS: 13
    • Android: 10.0
  • Android Support Library Version:
  • Nuget Packages: Minimal. Reproed with default Xamarin Project
  • Affected Devices: Pixel 3 Q 10.0 Emulator is where screenshots come from

Screenshots

See above

Reproduction Link

ItemSizingBugXF.zip

Workaround

None that I'm aware of. This is blocking an upgrade to 4.8

@lafritay lafritay added s/unverified New report that has yet to be verified t/bug 🐛 labels Sep 18, 2020
@rmarinho rmarinho added 4.8.0 regression on 4.8.0 i/regression p/iOS 🍎 a/collectionview and removed s/unverified New report that has yet to be verified labels Sep 22, 2020
@hartez hartez added the e/6 🕕 6 label Sep 22, 2020
@hartez hartez self-assigned this Sep 22, 2020
@modplug
Copy link
Contributor

modplug commented Sep 24, 2020

Is there any workaround for this?
We suddenly got reports on this from our customers and since we rely on certain 4.8 features I don't want to go through the hassle and downgrade Xamarin Forms while a proper fix is implemented

@lafritay
Copy link
Author

@modplug I'm not aware of a workaround. I'm using the workarounds mentioned in this issue (#10842) for iOS and those didn't seem to immediately fix the problem but I didn't go very deep there and I didn't try to do something similar for Android.

@hartez
Copy link
Contributor

hartez commented Oct 13, 2020

@lafritay I'm looking at this bug now, and hopefully we can find a solution soon. In the meantime, in your repro project you can work around the issue by changing the height of your grid row from "*" to "Auto".

hartez added a commit that referenced this issue Oct 13, 2020
@hartez hartez added the in-progress This issue has an associated pull request that may resolve it! label Oct 13, 2020
@lafritay
Copy link
Author

@hartez Thanks for the workaround. I was able to apply that to my app and get things working. While doing so, I did notice a layout issue even when Auto is used. I'm assuming they are related so I'm including the sample here.

App2.zip

Even though we're using Auto everywhere, notice that the description in rows 4 and 5 is still getting clipped:

image

Good luck with the fix!

@lafritay
Copy link
Author

@hartez Thanks for fixing this! Is there any chance this makes it to a 4.8.* servicing release since it was a regression? Or will we have to wait for 5.0.0?

@hartez
Copy link
Contributor

hartez commented Oct 26, 2020

@lafritay This was merged into 4.8, so it should be available in the next service release for 4.8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.8.0 regression on 4.8.0 a/collectionview e/6 🕕 6 i/regression in-progress This issue has an associated pull request that may resolve it! p/Android p/iOS 🍎 t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants