-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Shell Tab is still visible after set Tab.IsVisible to false #24161
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2e4c2d8
894511 : Shell Tab is still visible after set Tab.IsVisible to false
SuthiYuvaraj 50b9f50
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj fe79043
Commit for test cases changes
SuthiYuvaraj 3078091
894511 : Review changes
SuthiYuvaraj 8767a33
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj facbeb9
Commit for testcase changes
SuthiYuvaraj 2443654
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj 47d9893
Commit for proper flyout width
SuthiYuvaraj 23de44a
Merge branch 'fix-894511' of https://github.com/SuthiYuvaraj/maui int…
SuthiYuvaraj b1fc394
Review changes
SuthiYuvaraj 1c9728f
Image added
SuthiYuvaraj e3d1e93
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj 89a741f
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj 9f94afd
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj 978b0a5
894511 : Commit for windows
SuthiYuvaraj d1a6fa0
Merge branch 'dotnet:main' into fix-894511
SuthiYuvaraj 72ac0e3
894511 : Fix for iOS included
SuthiYuvaraj 7dc9506
Fix: 894511 : Review changes
SuthiYuvaraj bf76b02
Fix:894511 : Images Added
SuthiYuvaraj 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 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 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 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 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
Binary file added
BIN
+32.3 KB
...ts/snapshots/android/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml
This file contains 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,25 @@ | ||
<?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.Issue8788" | ||
xmlns:local="clr-namespace:Maui.Controls.Sample.Issues" | ||
Shell.FlyoutBehavior="Locked" | ||
Shell.FlyoutWidth="200"> | ||
|
||
<MenuItem x:Name="MenuItem" Text="Click to hide Tab1" Clicked="MenuItem_Clicked" AutomationId="FirstButton" /> | ||
|
||
<TabBar> | ||
<Tab x:Name="Tab1" AutomationId="Tab1" Title="Tab 1"> | ||
<ShellContent Title="Tab 1" ContentTemplate="{DataTemplate local:MainTabPage}" Route="MainPage" /> | ||
</Tab> | ||
|
||
<Tab x:Name="Tab2" AutomationId="Tab2" Title="Tab 2" IsVisible="false"> | ||
<ShellContent Title="Tab 2" ContentTemplate="{DataTemplate local:SecondTabPage}" Route="Tab2Page" /> | ||
</Tab> | ||
|
||
<Tab x:Name="Tab3" Title="Tab 3" AutomationId="Tab3" IsVisible="false"> | ||
<ShellContent Title="Tab 3" ContentTemplate="{DataTemplate local:ThirdTabPage}" Route="Tab3Page" /> | ||
</Tab> | ||
</TabBar> | ||
|
||
</Shell> |
81 changes: 81 additions & 0 deletions
81
src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml.cs
This file contains 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,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 8788, "Shell Tab is still visible after set Tab.IsVisible to false", PlatformAffected.Android)] | ||
public partial class Issue8788 : Shell | ||
{ | ||
public Issue8788() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void MenuItem_Clicked(object sender, EventArgs e) | ||
{ | ||
#if ANDROID | ||
Tab2.IsVisible = true; | ||
Tab3.IsVisible = true; | ||
Tab1.IsVisible = false; | ||
#else | ||
Tab1.IsVisible = false; | ||
Tab2.IsVisible = true; | ||
Tab3.IsVisible = true; | ||
#endif | ||
} | ||
} | ||
|
||
public partial class MainTabPage : ContentPage | ||
{ | ||
public MainTabPage() | ||
{ | ||
Content = new VerticalStackLayout() | ||
{ | ||
new Label(){ | ||
Text = "Page Loaded in first Tab", | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center, | ||
TextDecorations = TextDecorations.Underline, | ||
|
||
}, | ||
}; | ||
} | ||
} | ||
|
||
public partial class SecondTabPage : ContentPage | ||
{ | ||
public SecondTabPage() | ||
{ | ||
Content = new VerticalStackLayout() | ||
{ | ||
new Label(){ | ||
Text = "Page Loaded in Second Tab", | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center, | ||
TextDecorations = TextDecorations.Underline, | ||
|
||
}, | ||
}; | ||
} | ||
} | ||
public partial class ThirdTabPage : ContentPage | ||
{ | ||
public ThirdTabPage() | ||
{ | ||
Content = new VerticalStackLayout() | ||
{ | ||
new Label(){ | ||
Text = "Page Loaded in Third Tab", | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center, | ||
TextDecorations = TextDecorations.Underline, | ||
|
||
}, | ||
}; | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8788.cs
This file contains 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,28 @@ | ||
#if !MACCATALYST | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
internal class Issue8788 : _IssuesUITest | ||
{ | ||
public Issue8788(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "Shell Tab is still visible after set Tab.IsVisible to false"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void ShellTabItemsShouldUpdateForDynamicChangesInVisibility() | ||
{ | ||
#if WINDOWS | ||
App.TapCoordinates(100, 57); | ||
#else | ||
App.WaitForElement("FirstButton"); | ||
App.Tap("FirstButton"); | ||
#endif | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} | ||
#endif |
Binary file added
BIN
+9.15 KB
...ts/snapshots/windows/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71.9 KB
....Tests/snapshots/ios/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
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.
Next time when we can lets use the
is null
.