-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Navigation from the 'more' tab #26292
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [Issue(IssueTracker.Github, 18193, "[iOS] Navigation doesn't work on sixth tab in shell", PlatformAffected.iOS)] | ||
|
PureWeen marked this conversation as resolved.
|
||
| public class Issue18193 : Shell | ||
| { | ||
| public Issue18193() | ||
| { | ||
| var tabBar = new TabBar(); | ||
|
|
||
| tabBar.Items.Add(CreateShellContent("MainPage", typeof(Issue18193MainPage), nameof(Issue18193MainPage))); | ||
| tabBar.Items.Add(CreateShellContent("Page 2", typeof(Issue18193Page2), nameof(Issue18193Page2))); | ||
| tabBar.Items.Add(CreateShellContent("Page 3", typeof(Issue18193Page3), nameof(Issue18193Page3))); | ||
| tabBar.Items.Add(CreateShellContent("Page 4", typeof(Issue18193Page4), nameof(Issue18193Page4))); | ||
| tabBar.Items.Add(CreateShellContent("Page 5", typeof(Issue18193Page5), nameof(Issue18193Page5))); | ||
| tabBar.Items.Add(CreateShellContent("Page 6", typeof(Issue18193Page6), nameof(Issue18193Page6))); | ||
|
|
||
| Items.Add(tabBar); | ||
| Routing.RegisterRoute(nameof(Issue18193DetailPage), typeof(Issue18193DetailPage)); | ||
| } | ||
|
|
||
| ShellContent CreateShellContent(string title, Type contentType, string route) => new() | ||
| { | ||
| Title = title, | ||
| ContentTemplate = new DataTemplate(contentType), | ||
| Route = route | ||
| }; | ||
| } | ||
|
|
||
| class Issue18193MainPage : ContentPage | ||
| { | ||
| public Issue18193MainPage() | ||
| { | ||
| var button = new Button() { AutomationId = "NavigationToPage6Button", Text = "Navigate to page 6" }; | ||
| button.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page6)); | ||
| Content = button; | ||
| } | ||
| } | ||
|
|
||
| class Issue18193DetailPage : ContentPage | ||
| { | ||
| public Issue18193DetailPage() | ||
| { | ||
| Title = "Detail Page"; | ||
| var button = new Button() { AutomationId = "NavigateBackButton", Text = "Navigate back" }; | ||
| button.Clicked += (s, e) => Issue18193.Current.GoToAsync(".."); | ||
| Content = button; | ||
| } | ||
| } | ||
|
|
||
| class Issue18193Page2 : ContentPage | ||
| { | ||
| public Issue18193Page2() | ||
| { | ||
| Content = new Button() | ||
| { | ||
| Text = "Navigate to page 5", | ||
| Command = new Command(async () => await Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page5))), | ||
| AutomationId = "NavigateToPage5Button" | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| public class Issue18193Page3 : ContentPage { } | ||
|
|
||
| public class Issue18193Page4 : ContentPage { } | ||
|
|
||
| public class Issue18193Page5 : ContentPage { } | ||
|
|
||
| public class Issue18193Page6 : ContentPage | ||
| { | ||
| public Issue18193Page6() | ||
| { | ||
| var button = new Button() { AutomationId = "NavigateToDetailButton", Text = "Navigate to detail page" }; | ||
| button.Clicked += (s, e) => Issue18193.Current.GoToAsync(nameof(Issue18193DetailPage)); | ||
|
|
||
| var button2 = new Button() { AutomationId = "NavigateToPage2Button", Text = "Navigate to Page 2" }; | ||
| button2.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page2)); | ||
| Content = new StackLayout | ||
| { | ||
| Children = | ||
| { | ||
| button, | ||
| button2 | ||
| } | ||
| }; | ||
| } | ||
| } | ||
| } | ||
35 changes: 35 additions & 0 deletions
35
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18193.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,35 @@ | ||
| #if IOS | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| public class Issue18193 : _IssuesUITest | ||
| { | ||
| public override string Issue => "[iOS] Navigation doesn't work on sixth tab in shell"; | ||
|
|
||
| public Issue18193(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Shell)] | ||
| public void ShellNavigationShouldWorkInMoreTab() | ||
|
mattleibow marked this conversation as resolved.
|
||
| { | ||
| App.WaitForElement("NavigationToPage6Button"); | ||
| App.Click("NavigationToPage6Button"); | ||
|
mattleibow marked this conversation as resolved.
|
||
| App.WaitForElement("NavigateToDetailButton"); | ||
| App.Click("NavigateToDetailButton"); | ||
| App.WaitForElement("NavigateBackButton"); | ||
| App.Click("NavigateBackButton"); | ||
| App.WaitForElement("NavigateToPage2Button"); | ||
| App.Click("NavigateToPage2Button"); | ||
| App.WaitForElement("NavigateToPage5Button"); | ||
| App.Click("NavigateToPage5Button"); | ||
| App.WaitForElement("More"); | ||
| App.Click("More"); | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.