-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bring back iOS SetNeedsLayout propagation via inheritance #28434
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
Bring back iOS SetNeedsLayout propagation via inheritance #28434
Conversation
|
Hey there @albyrock87! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
ec246ac to
80abb6e
Compare
80abb6e to
d61577c
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. However, I think the previous changes have sense but just enabling a way to stop the propagation like InvalidateMeasure(bool isPropagating = false); So, let's create a new Spec for .NET 10 and you could work on it if want.
|
@jsuarezruiz if creating an This will also spare me some refactoring on #28225 Something like: public override void SetNeedsLayout()
{
if (IPlatformMeasureInvalidationController.IsInvalidating)
{
// TODO: NET10 move propagation loop back to iOS `ViewExtensions`
var controller = (IPlatformMeasureInvalidationController)this;
if (controller.InvalidateMeasure(IPlatformMeasureInvalidationController.IsPropagatingInvalidation))
{
this.InvalidateParentMeasure();
}
} else {
base.SetNeedsLayout();
}
}
bool IPlatformMeasureInvalidationController.InvalidateMeasure(bool isPropagating)
{
base.SetNeedsLayout();
return true;
} |
PureWeen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still chatting with Alberto
|
Not needed anymore. Let's try to evolve on the existing implementation. |
Description of Change
#26629 removed
SetNeedsLayoutpropagation via inheritance, this was needed to fix #24996.Unfortunately, this also removed the ability to intercept and stop propagation as needed.
A good option here would be to make
IPlatformMeasureInvalidationControllerpublic and changevoid InvalidateMeasure(bool isPropagating = false);return type tobool, so that anyone could stop propagation in case of need.This seems to me the best and clean option, but unless MAUI team makes an exception, we cannot touch PublicAPI in a Service Release.
For such reason, this PR brings back
SetNeedsLayoutpropagation, but it also includes a way to tell if theSetNeedsLayoutis being triggered by MAUI so we can avoid the issue described in #24996.Issues Fixed
Fixes #28410