-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix for unable to select a tab after backing out of a page and returning. #25011
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
11 commits
Select commit
Hold shift + click to select a range
e8774bf
fix-24741-Reset the selected property for all item and mapped the IsS…
BagavathiPerumal c86d458
fix-24741-Removed the code that reset the MenuItemSource and added Pr…
BagavathiPerumal 89016af
fix-24741-Optimized the fix by making SelectedItem null in DisConnect…
BagavathiPerumal 8b8886d
fix-24741-Optimized the fix.
BagavathiPerumal a0a366c
Added UITest
jsuarezruiz 30cca7c
fix-24741-Resolved the TitleColor not updating issue.
BagavathiPerumal bd85bc2
Fixed UITest
jsuarezruiz d5f052e
fix-24741-Testcase changes updated.
BagavathiPerumal 7fc9118
fix-24741-Added testcase screenshot.
BagavathiPerumal dfc1643
fix-24741-Updated testcase screenshot.
BagavathiPerumal efeab16
Merge branch 'main' into fix-24741
jsuarezruiz 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [Issue(IssueTracker.Github, 24741, "Unable to select tab after backing out of page and returning", PlatformAffected.UWP)] | ||
| public class Issue24741 : NavigationPage | ||
| { | ||
| public Issue24741() : base(new TestPage()) | ||
| { | ||
| } | ||
|
|
||
| public class TestPage : TestContentPage | ||
| { | ||
| protected override void Init() | ||
| { | ||
| Title = "Issue 24741"; | ||
|
|
||
| var navigationButton = new Button | ||
| { | ||
| AutomationId = "NavigateButton", | ||
| Text = "Navigate to TabbedPage" | ||
| }; | ||
|
|
||
| navigationButton.Clicked += (s, e) => | ||
| { | ||
| Navigation.PushAsync(new Issue24741TabbedPage()); | ||
| }; | ||
|
|
||
| var content = new VerticalStackLayout | ||
| { | ||
| navigationButton | ||
| }; | ||
|
|
||
| Content = content; | ||
| } | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/Controls/tests/TestCases.HostApp/Issues/Issue24741TabbedPage.xaml
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,9 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <TabbedPage | ||
| xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| x:Class="Maui.Controls.Sample.Issues.Issue24741TabbedPage" | ||
| xmlns:issues="clr-namespace:Maui.Controls.Sample.Issues"> | ||
| <issues:Issue24741Page1 /> | ||
| <issues:Issue24741Page2 /> | ||
| </TabbedPage> |
57 changes: 57 additions & 0 deletions
57
src/Controls/tests/TestCases.HostApp/Issues/Issue24741TabbedPage.xaml.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,57 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| public partial class Issue24741TabbedPage : TabbedPage | ||
| { | ||
| public Issue24741TabbedPage() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
| } | ||
|
|
||
| public class Issue24741Page1 : ContentPage | ||
| { | ||
| public Issue24741Page1() | ||
| { | ||
| Title = "Page 1"; | ||
|
|
||
| var content = new Button | ||
| { | ||
| AutomationId = "Page1Button", | ||
| Text = "Page 1" | ||
| }; | ||
|
|
||
| content.Clicked += async (sender, args) => | ||
| { | ||
| await Navigation.PopAsync(); | ||
| }; | ||
|
|
||
| Content = new VerticalStackLayout | ||
| { | ||
| content | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| public class Issue24741Page2 : ContentPage | ||
| { | ||
| public Issue24741Page2() | ||
| { | ||
| Title = "Page 2"; | ||
|
|
||
| var content = new Button | ||
| { | ||
| AutomationId = "Page2Button", | ||
| Text = "Page 2" | ||
| }; | ||
|
|
||
| content.Clicked += async (sender, args) => | ||
| { | ||
| await Navigation.PopAsync(); | ||
| }; | ||
|
|
||
| Content = new VerticalStackLayout | ||
| { | ||
| content | ||
| }; | ||
| } | ||
| } |
46 changes: 46 additions & 0 deletions
46
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24741.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,46 @@ | ||
| #if WINDOWS | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| public class Issue24741 : _IssuesUITest | ||
| { | ||
| public Issue24741(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "Unable to select tab after backing out of page and returning"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.TabbedPage)] | ||
| public void SelectTabAfterNavigation() | ||
PureWeen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| const string Page2Title = "Page 2"; | ||
|
|
||
| // 1. Navigate to the TabbedPage. | ||
| App.WaitForElement("NavigateButton"); | ||
| App.Tap("NavigateButton"); | ||
|
|
||
| // 2. Click the second Tab. | ||
| App.Tap(Page2Title); | ||
|
|
||
| // 3. Navigate back. | ||
| App.WaitForElement("Page2Button"); | ||
| App.Tap("Page2Button"); | ||
|
|
||
| // 4. Repeat the process. Navigate to the TabbedPage. | ||
| App.WaitForElement("NavigateButton"); | ||
| App.Tap("NavigateButton"); | ||
|
|
||
| // 2. Click the second Tab. | ||
| App.Tap(Page2Title); | ||
|
|
||
| // 6. Screenshot to validate the result. | ||
| VerifyScreenshot(); | ||
| App.Back(); | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
Binary file added
BIN
+6.71 KB
...rols/tests/TestCases.WinUI.Tests/snapshots/windows/SelectTabAfterNavigation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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.