Skip to content

Commit 9663717

Browse files
kubafloCopilot
andcommitted
Address review feedback: add Superview null guard and enable MacCatalyst test
- Add null-conditional on Superview in InvalidateMeasure to prevent NullReferenceException during view lifecycle transitions - Enable header/footer resize test for MacCatalyst since the fix applies to both iOS and MacCatalyst Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 567f259 commit 9663717

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutHeaderContainer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ void IPlatformMeasureInvalidationController.InvalidateAncestorsMeasuresWhenMoved
3939

4040
bool IPlatformMeasureInvalidationController.InvalidateMeasure(bool isPropagating)
4141
{
42-
var size = SizeThatFits(new CGSize(Superview.Frame.Width, double.PositiveInfinity));
42+
var width = Superview?.Frame.Width ?? Frame.Width;
43+
var size = SizeThatFits(new CGSize(width, double.PositiveInfinity));
4344
Frame = new CGRect(Frame.X, Frame.Y, size.Width, size.Height);
4445
return false;
4546
}

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/HeaderFooterShellFlyout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void AFlyoutTests()
6767

6868
// verify header and footer react to size changes
6969
// On Windows, the stack layout's AutomationId isn't behaving as expected, so the Y position of the first flyout item is used to verify header and footer sizes.
70-
#if ANDROID || IOS
70+
#if ANDROID || IOS || MACCATALYST
7171

7272
App.Tap(ResizeHeaderFooter);
7373
var headerSizeSmall = App.WaitForElement("HeaderView").GetRect();

0 commit comments

Comments
 (0)