Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void LayoutChildren(bool animated)

if (IsRTL && !FlyoutOverlapsDetailsInPopoverMode)
{
flyoutFrame.X = (int)(flyoutFrame.Width * .25);
flyoutFrame.X = (int)(frame.Width - flyoutFrame.Width);
}

var detailsFrame = frame;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST
// Orientation not supported in Catalyst and Windows
// On iOS FlyoutPage RTL is not working as expected, Issue: https://github.com/dotnet/maui/issues/26726
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand Down Expand Up @@ -35,8 +34,8 @@ public void RootViewMovesAndContentIsVisible()
Assert.That(positionStart, Is.Not.EqualTo(secondPosition));
}

[Test]
public void RootViewSizeDoesntChangeAfterBackground()
[Test]
public async Task RootViewSizeDoesntChangeAfterBackground()
{
var idiom = App.WaitForElement("Idiom");
App.SetOrientationLandscape();
Expand All @@ -52,6 +51,17 @@ public void RootViewSizeDoesntChangeAfterBackground()
App.WaitForNoElement("RootLayout");
App.ForegroundApp();
var newWindowSize = App.WaitForElement("RootLayout");

// Poll until the width stabilizes. After foregrounding, some platforms (esp. Android/iOS)
// may momentarily report an intermediate layout size while the window / flyout re-applies
// RTL + orientation constraints. This loop prevents test flakiness by waiting for the
// final (restored) size instead of asserting too early
int retries = 50;
while (newWindowSize.GetRect().Width != windowSize.GetRect().Width && retries-- > 0)
{
await Task.Delay(100);
}

Assert.That(newWindowSize.GetRect().Width, Is.EqualTo(windowSize.GetRect().Width));
Assert.That(newWindowSize.GetRect().Height, Is.EqualTo(windowSize.GetRect().Height));
}
Expand Down
Loading