Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid: Not getting invalidated when changing the Height/Width of Row/ColumnDefinitions declared with the short syntax #25983

Open
eli-popova opened this issue Nov 20, 2024 · 1 comment · May be fixed by #26046
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter partner Issue or Request from a partner team platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@eli-popova
Copy link

Description

When declaring the RowDefinitions of a grid using the short syntax and then changing the Height property of a row, the grid doesn't get invalidated and the change takes effect after some other action invalidates the grid - for example if the window is resized (same for ColumnDefinitions).

Looking at: https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/RowDefinitionCollectionTypeConverter.cs#L31 and https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/DefinitionCollection.cs#L15 the SizeChanged event isn't triggered in this case, whereas adding the rows one by one triggers the SizeChanged event - https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/DefinitionCollection.cs#L21.

I believe we should have the same behavior when using the short syntax for Row/ColumnDefinitions.

Steps to Reproduce

  1. Run the project
  2. Click the Resize button
  3. Observation: The blue row doesn't change its height
  4. Expected: The blue row to increase its height
  5. Comment the first grid with RowDefinitions declared with the short xaml syntax
  6. Uncomment the second grid
  7. Click the Resize button
  8. Observation: The blue row's height is increased as expected

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/GridRowsShortSyntaxIssue

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

Call InvalidateMeasure after changing the value of Height/Width of Row/ColumnDefinitions.

Note: This may not fully cover everything that is missing out.

Relevant log output

@eli-popova eli-popova added the t/bug Something isn't working label Nov 20, 2024
@PureWeen PureWeen added partner Issue or Request from a partner team area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels Nov 20, 2024
@PureWeen PureWeen added this to the .NET 9 Servicing milestone Nov 20, 2024
@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Nov 21, 2024
@ninachen03
Copy link

This issue has been verified using Visual Studio 17.13.0 Preview 1.0 (9.0.10 & 9.0.0 & 8.0.100 &8.0.3). Can repro it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter partner Issue or Request from a partner team platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
5 participants