maui icon indicating copy to clipboard operation
maui copied to clipboard

CollectionView doesn't update the item size when content in ItemTemplate is resized

Open Alexgoon opened this issue 1 year ago • 15 comments

Description

The issue is described at #3643, but marked as fixed. However, it still occurs on iOS. We checked it in .NET MAUI 7.0.59. Would you please clarify if you specified the "fixed-in" version correctly?

Steps to Reproduce

Create a MAUI app

  • Put Button and CollectionView into StackLayout on the MainPage.xaml
  • Set ItemTemplate for CollectionView, put into ItemTemplate Grid with Label
  • In the Button.Clicked event handler change Label.Text
  • Deploy to iOS simulator and click the Button

Link to public reproduction project repository

https://github.com/dotnet/maui/files/8130080/3643.zip

Version with bug

7.0.59

Last version that worked well


Affected platforms

iOS

Affected platform versions

iPhone 14 Pro Max

Did you find any workaround?

Call the PlatformSizeChanged method for the element used as the ItemTemplate root

Relevant log output

No response

Alexgoon avatar Apr 03 '23 11:04 Alexgoon

Are you using 6.0.312?. The issue have been backported to net7 https://github.com/dotnet/maui/pull/12457

jsuarezruiz avatar Apr 03 '23 14:04 jsuarezruiz

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

ghost avatar Apr 03 '23 14:04 ghost

Hi @Alexgoon. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Apr 03 '23 14:04 ghost

I apologize for the misleading information. The issue occurs in 7.0.59, not in 6.0.312. I've corrected my initial post

Alexgoon avatar Apr 04 '23 10:04 Alexgoon

I have the same issue. Does anyone know a workaround?

NikolaJackova avatar Apr 20 '23 19:04 NikolaJackova

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. This issue repro on iOS 16.4, not repro on Windows 11 and 13.0-API33 with below Project: MauiApp14.zip

XamlTest avatar Jun 26 '23 07:06 XamlTest

@rmarinho @hartez you guys know why the supposed fix from #12457 is no longer working?

FlavioGoncalves-Cayas avatar Jan 05 '24 09:01 FlavioGoncalves-Cayas

Verified the issue on .NET 8, VS 2022 Version 17.9.0, iOS 17.3

evgenyKozlov1996 avatar Feb 15 '24 15:02 evgenyKozlov1996

Just tried using CollectionView since ListView has this problem also... our items have dynamic content, we update the item contents based on user interaction and when data changes. For some scenarios we can do fixed heights, but we'd have to redesign them... but some are such that we can't always do a fixed height design...

Here are a couple for ListView, there are probably more reported. #7967 #8239 #15053

Not to be negative, but it feels like I'm spending more time trying to work around these types of issues than actually building our app.

Cybrosys avatar Mar 01 '24 12:03 Cybrosys

HI

Any workaround or solution for this.

letscodewithkalyan avatar May 02 '24 09:05 letscodewithkalyan

If you don't mind a hacky workaround, ListView does resize if you call ObservableCollection.Move(...) from the current index to the same value. Somehow, it triggers the resizing for me.

(Unfortunately, I have already moved to CollectionView, still stuck with this problem.)

billylo1 avatar Jun 08 '24 01:06 billylo1