-
Notifications
You must be signed in to change notification settings - Fork 1.9k
26598 - Fix for Tabbar disappears when navigating back from page with hidden TabBar in iOS 18 #27582
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
Merged
Merged
26598 - Fix for Tabbar disappears when navigating back from page with hidden TabBar in iOS 18 #27582
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a68edb6
Update ShellPageRendererTracker.cs
SuthiYuvaraj b78a755
Update ShellPageRendererTracker.cs
SuthiYuvaraj 6ebad00
testcases
SuthiYuvaraj 06baee2
Update Issue26598.cs
SuthiYuvaraj f0069a8
Update Issue26598.cs
SuthiYuvaraj 90a5fc3
- fix appearing from firing too early when popping modal pages
PureWeen e7f6b78
Commit for testcase changes
SuthiYuvaraj 3b9c92e
- add test to cover popping through multiple modals and shell pages
PureWeen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
src/Controls/tests/TestCases.HostApp/Issues/Issue26598.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| using Microsoft.Maui.Controls; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues; | ||
| [Issue(IssueTracker.Github, 26598, "Tabbar disappears when navigating back from page with hidden TabBar in iOS", PlatformAffected.iOS)] | ||
| public class Issue26598 : TestShell | ||
| { | ||
| TabBar tabBar = new TabBar(); | ||
|
|
||
| // Create first ShellContent | ||
| ShellContent homeShellContent = new ShellContent | ||
| { | ||
| ContentTemplate = new DataTemplate(() => new Issue26598Home()), | ||
| Title = "HomeTab", | ||
| AutomationId = "Issue26598Home", | ||
| Route = nameof(Issue26598Home) | ||
| }; | ||
|
|
||
| // Create second ShellContent | ||
| ShellContent recentShellContent = new ShellContent | ||
| { | ||
| ContentTemplate = new DataTemplate(() => new Issue26598Recent()), | ||
| Title = "RecentTab", | ||
| Route = nameof(Issue26598Recent) | ||
| }; | ||
|
|
||
| protected override void Init() | ||
| { | ||
| Routing.RegisterRoute("Issue26598Inner", typeof(Issue26598Inner)); | ||
| Routing.RegisterRoute(nameof(Issue26589NonTab), typeof(Issue26589NonTab)); | ||
| tabBar.Items.Add(homeShellContent); | ||
| tabBar.Items.Add(recentShellContent); | ||
| Items.Add(tabBar); | ||
| } | ||
|
|
||
| public class Issue26598Home : ContentPage | ||
| { | ||
| VerticalStackLayout stackLayout; | ||
| Button button; | ||
| public Issue26598Home() | ||
| { | ||
| Title = "Home"; | ||
| HeightRequest = 200; | ||
| stackLayout = new VerticalStackLayout(); | ||
| button = new Button() | ||
| { | ||
| Text = "Navigate to InnerTab", | ||
| AutomationId = "NavigateToInnerTab", | ||
| VerticalOptions = LayoutOptions.Center, | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| }; | ||
| button.Clicked += Button_OnClicked; | ||
| stackLayout.Add(button); | ||
| Shell.SetTabBarIsVisible(this, false); | ||
| this.Content = stackLayout; | ||
| } | ||
|
|
||
| private void Button_OnClicked(object sender, EventArgs e) | ||
| { | ||
| Shell.Current.GoToAsync(nameof(Issue26598Inner)); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public class Issue26598Inner : ContentPage | ||
| { | ||
| VerticalStackLayout stackLayout; | ||
| Button button; | ||
| public Issue26598Inner() | ||
| { | ||
| Title = "InnerTab"; | ||
| stackLayout = new VerticalStackLayout(); | ||
| button = new Button() | ||
| { | ||
| Text = "Navigate to TabBarPage", | ||
| AutomationId = "NavigateToTabBarPage", | ||
| VerticalOptions = LayoutOptions.Center, | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| }; | ||
| button.Clicked += Button_OnClicked; | ||
| stackLayout.Add(button); | ||
| Shell.SetTabBarIsVisible(this, true); | ||
| this.Content = stackLayout; | ||
| } | ||
|
|
||
| private void Button_OnClicked(object sender, EventArgs e) | ||
| { | ||
| Shell.Current.GoToAsync(nameof(Issue26589NonTab)); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public class Issue26598Recent : ContentPage | ||
| { | ||
| VerticalStackLayout stackLayout; | ||
| Label label; | ||
| public Issue26598Recent() | ||
| { | ||
| Title = "Recent"; | ||
| HeightRequest = 200; | ||
|
|
||
| stackLayout = new VerticalStackLayout(); | ||
| label = new Label() | ||
| { | ||
| Text = "Page Loaded in Recent Tab", | ||
| VerticalOptions = LayoutOptions.Center, | ||
| HorizontalOptions = LayoutOptions.Center, | ||
|
|
||
| }; | ||
| stackLayout.Add(label); | ||
| Shell.SetTabBarIsVisible(this, true); | ||
| this.Content = stackLayout; | ||
| } | ||
| } | ||
| public class Issue26589NonTab : ContentPage | ||
| { | ||
| VerticalStackLayout stackLayout; | ||
| Label label1; | ||
| public Issue26589NonTab() | ||
| { | ||
| Title = "NoTabBarPage"; | ||
| stackLayout = new VerticalStackLayout(); | ||
| label1 = new Label() | ||
| { | ||
| Text = "This is Non TabBarPage", | ||
| AutomationId = "Issue26589NonTab", | ||
| VerticalOptions = LayoutOptions.Center, | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| }; | ||
| stackLayout.Add(label1); | ||
| Shell.SetTabBarIsVisible(this, false); | ||
| this.Content = stackLayout; | ||
| } | ||
|
|
||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26598.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using NUnit.Framework; | ||
| using NUnit.Framework.Legacy; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue26598 : _IssuesUITest | ||
| { | ||
| public override string Issue => "Tabbar disappears when navigating back from page with hidden TabBar in iOS"; | ||
|
|
||
| #if ANDROID | ||
| const string back = ""; | ||
| #else | ||
| const string back = "InnerTab"; | ||
| #endif | ||
|
|
||
| public Issue26598(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Shell)] | ||
| public void TabBarShouldbeVisibleNavigatingBackFromNonTabbedPage() | ||
| { | ||
| // Is a iOS issue; see https://github.com/dotnet/maui/issues/26598 | ||
| // Initially TabBar for Issue26598Home is hidden | ||
| App.WaitForElement("NavigateToInnerTab"); | ||
| App.Click("NavigateToInnerTab"); | ||
|
|
||
| // Case 1 - After navigating to Inner Page , the TabBar should be visible | ||
| App.WaitForElement("RecentTab"); | ||
|
|
||
| // Case 2 - Navigate to the InnerTabPage where the TabBar is hidden | ||
| App.WaitForElement("NavigateToTabBarPage"); | ||
| App.Click("NavigateToTabBarPage"); | ||
| App.WaitForElement("Issue26589NonTab"); | ||
|
|
||
| // Case 3 - Navigate back to the HomeTab, the TabBar should be visible | ||
| App.TapBackArrow(back); | ||
| App.WaitForElement("RecentTab"); | ||
| App.Click("RecentTab"); | ||
| App.WaitForElement("HomeTab"); | ||
| App.Click("HomeTab"); | ||
| App.WaitForElement("RecentTab"); | ||
| } | ||
| } | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we do something in the UI from the UITest, like update a Label Text, to validate the correct behavior with the Appearing method?
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.
This existing test covers the modal scenario here
I've added
To cover popping multiple pages down to a shell page to ensure appearing still fires