Skip to content

MeasureInvalidated events are now fired too often #25264

Open

Description

Description

PR #23052 broke our unit tests where we ensure that we don't get too many layout cycles from changing the binding contexts. While the PR itself fixed a real problem it introduces another one. Visual elements that are constrained to certain size from the top of the hierarchy don't break the propagation of the MeasureInvalidated event from the children here:

if (child.IsVisible)
{
// We need to invalidate measures only if child is actually visible
MeasureInvalidated?.Invoke(this, new InvalidationEventArgs(InvalidationTrigger.MeasureChanged));
(Parent as VisualElement)?.OnChildMeasureInvalidatedInternal(this, InvalidationTrigger.MeasureChanged);
}

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.90 SR9

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.82 SR8.2

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterplatform/android 🤖platform/iOS 🍎platform/macOS 🍏macOS / Mac Catalystplatform/windows 🪟potential-regressionThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type

    Projects

    • Status

      In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions