Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Controls/src/Core/NavigationPage/NavigationPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void OnWindowChanged(object sender, EventArgs e)
}

var flyoutPage = _toolbar.FindParentOfType<FlyoutPage>();
if (flyoutPage != null && flyoutPage.Parent is IWindow && flyoutPage.Toolbar == _toolbar)
if (flyoutPage is not null && flyoutPage.Toolbar == _toolbar)
{
flyoutPage.Toolbar = null;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33615.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 33615, "[Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage", PlatformAffected.Android)]
public class Issue33615 : TestFlyoutPage
{
NavigationPage _navigationPage;

protected override void Init()
{
Flyout = new ContentPage
{
Title = "Menu",
Content = new Label { Text = "Flyout Menu" }
};

var detailPage1 = new ContentPage { Title = "DetailPage1" };
_navigationPage = new NavigationPage(detailPage1);
Detail = _navigationPage;

detailPage1.Content = new VerticalStackLayout
{
VerticalOptions = LayoutOptions.Center,
Children =
{
new Button
{
Text = "Show NonFlyoutPage",
AutomationId = "ShowNonFlyoutButton",
Command = new Command(() =>
{
this.Window.Page = new Issue33615NonFlyoutPage(this);
})
},
new Button
{
Text = "Navigate to DetailPage2",
AutomationId = "NavigateToDetailPage2Button",
Command = new Command(async () =>
{
await _navigationPage.PushAsync(new ContentPage
{
Title = "DetailPage2",
Content = new Label
{
Text = "DetailPage2",
AutomationId = "DetailPage2Label"
}
});
})
},
new Label
{
Text = "DetailPage1",
AutomationId = "DetailPage1Label"
}
}
};
}
}

class Issue33615NonFlyoutPage : ContentPage
{
public Issue33615NonFlyoutPage(Page flyoutPage)
{
Title = "NonFlyoutPage";
Content = new VerticalStackLayout
{
VerticalOptions = LayoutOptions.Center,
Children =
{
new Label { Text = "NonFlyoutPage" },
new Button
{
Text = "Back to FlyoutPage",
AutomationId = "BackToFlyoutButton",
Command = new Command(() => this.Window.Page = flyoutPage)
}
}
};
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue33615 : _IssuesUITest
{
public Issue33615(TestDevice device) : base(device) { }

public override string Issue => "[Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage";

[Test]
[Category(UITestCategories.FlyoutPage)]
public void TitleUpdatesAfterShowingNonFlyoutPage()
{
// Wait for the FlyoutPage detail (DetailPage1) to load
App.WaitForElement("ShowNonFlyoutButton");

// Show a NonFlyoutPage by changing Window.Page
App.Tap("ShowNonFlyoutButton");

// Wait for the NonFlyoutPage to appear
App.WaitForElement("BackToFlyoutButton");

// Go back to the FlyoutPage
App.Tap("BackToFlyoutButton");

// Wait for the FlyoutPage to be restored with DetailPage1
App.WaitForElement("NavigateToDetailPage2Button");

// Navigate to DetailPage2 — the toolbar title should update to "DetailPage2"
App.Tap("NavigateToDetailPage2Button");

// Verify DetailPage2 is the current page
App.WaitForElement("DetailPage2Label");

// The toolbar title must match "DetailPage2" — use VerifyScreenshot to
// detect if the toolbar is frozen on the old title "DetailPage1"
VerifyScreenshot();
}
Comment thread
KarthikRajaKalaimani marked this conversation as resolved.
Comment thread
KarthikRajaKalaimani marked this conversation as resolved.
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading