-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make MeasureInvalidated
event work correctly
#23052
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@rmarinho are those failed test environment issues or are those caused by my chargers? |
Hi @albyrock87 seems we might have a issue with this test failing ..
|
b86d3f4
to
583aad9
Compare
@rmarinho thanks for the help, I've changed the code to account for the fact that usually child elements don't get removed: I mean, the dev pops the page from the stack and that's it. So basically I'm manually bubbling up the event from the child element to the parent. |
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.
Things to review before merging
-
can we achieve this through handlers vs events. Measure invalidated fires through command mapper so we could propagate that way which would be more core compliant
-
should we remove all the superview.setneedslayout calls from the iOS core code, with these changes that code shouldn't be needed.
@PureWeen I wanted to have a minimal impact with these changes to simply fix the bugs, but if that's the direction to take, I can refactor this to make it happen (also removing the SetNeedsLayout chain). |
After a bit of research this is what I can tell:
That said, our goals (IMHO) should be:
For the above mentioned reasons I think that the approach of my PR is correct, and it's probably the only achievable choice for a SR release where we don't want to change public APIs. For .NET9, we could:
This also gives us the possibility to be smart (i.e. on |
/rebase |
583aad9
to
476313c
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Hi, when will this be merge ? |
476313c
to
dd9451e
Compare
/azp run |
@billylo1 the fix will be available in SR9 |
…sureInvalidatedBehavior app context switch
…sureInvalidatedBehavior app context switch
…sureInvalidatedBehavior app context switch
…sureInvalidatedBehavior app context switch
* Revert PR #23052 behavior under new Microsoft.Maui.UseLegacyMeasureInvalidatedBehavior app context switch * Align the switch name with .NET 9 switches --------- Co-authored-by: Filip Navara <[email protected]>
…validatedBehavior app context switch
…t switch (#25677) * Revert PR #23052 behavior under new Microsoft.Maui.UseLegacyMeasureInvalidatedBehavior app context switch * Align the switch name with .NET 9 switches --------- Co-authored-by: Filip Navara <[email protected]>
Description of Change
MeasureInvalidated
event was working fine on Xamarin, while on MAUI we basically forgot about bubbling up the event.This causes the issues below where the system relays on this event to do something, like resizing the cell of a collection view.
This PR brings back the
MeasureInvalidated
event trigger on parents.I've adjusted Xamarin components like
Layout
andPage
to leverage the new internal method I put onVisualElement
.I've re-enabled the collection view testing gallery regarding dynamic sizing of elements in collection view.
I don't have much time available right now, so if you need to add more tests, feel free to do it.
Issues Fixed
Fixes #15177
Fixes #20181
Fixes #22978