Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void UpdateMoreCellsEnabled()

UITableViewCell[] GetMoreNavigationCells()
{
if (MoreNavigationController.TopViewController.View is UITableView uITableView)
if (MoreNavigationController.TopViewController.View is UITableView uITableView && uITableView.Window is not null)
return uITableView.VisibleCells;

return EmptyUITableViewCellArray;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue22452.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue22452"
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues"
Shell.FlyoutBehavior="Locked">

<FlyoutItem Title="FlyoutItem">
<Tab>
<ShellContent ContentTemplate="{DataTemplate ns:Issue22452Content}" />
</Tab>
</FlyoutItem>
</Shell>
32 changes: 32 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue22452.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 22452, "Fix error when running new template maui app on iOS", PlatformAffected.iOS)]
public partial class Issue22452 : Shell
{
public Issue22452()
{
InitializeComponent();
}
}

public class Issue22452Content : ContentPage
{
public Issue22452Content()
{
Content = new StackLayout
{
Children =
{
new Label
{
AutomationId="TabContent",
Text = "TabContent"
}
},

IgnoreSafeArea = false
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Diagnostics;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

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

public override string Issue => "Fix error when running new template maui app on iOS";

[Test]
[Category(UITestCategories.Shell)]
public void NavigationBetweenFlyoutItems()
{
App.WaitForElement("TabContent");
VerifyScreenshot();
}
}
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.