diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs index 8eee04ab2818..d969e5691f27 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs @@ -295,13 +295,7 @@ protected override void OnDisplayedPageChanged(Page newPage, Page oldPage) oldPage.PropertyChanged -= OnDisplayedElementPropertyChanged; if (newPage is not null) - { newPage.PropertyChanged += OnDisplayedElementPropertyChanged; - if (oldPage is null) - { - _menuSetup = false; - } - } if (newPage is not null && !_menuSetup) { diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs index e11344300ad0..528eaa84a495 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs @@ -357,10 +357,6 @@ void GoTo(ShellSection shellSection) if (shellSection == null || _currentSection == shellSection) return; var renderer = RendererForShellContent(shellSection); - - if (renderer == null) - return; - if (renderer?.ViewController != SelectedViewController) SelectedViewController = renderer.ViewController; CurrentRenderer = renderer; diff --git a/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs b/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs index 96121f5e6373..b60e49ca4126 100644 --- a/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs +++ b/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs @@ -432,7 +432,7 @@ void OnCurrentShellSectionPropertyChanged(object? sender, System.ComponentModel. if (_mainLevelTabs == null) return; - var currentItem = VirtualView.CurrentItem?.CurrentItem; + var currentItem = VirtualView.CurrentItem.CurrentItem; NavigationViewItemViewModel? navigationViewItemViewModel = null; foreach (var item in _mainLevelTabs) diff --git a/src/Controls/src/Core/Shell/ShellItem.cs b/src/Controls/src/Core/Shell/ShellItem.cs index 501ebf21c945..40bd26c3a6c4 100644 --- a/src/Controls/src/Core/Shell/ShellItem.cs +++ b/src/Controls/src/Core/Shell/ShellItem.cs @@ -284,10 +284,7 @@ static void OnCurrentItemChanged(BindableObject bindable, object oldValue, objec var shellItem = (ShellItem)bindable; if (newValue == null) - { - shellItem.CurrentItem = null; return; - } if (shellItem.Parent is Shell) { diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png deleted file mode 100644 index 55251cdceb7c..000000000000 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png and /dev/null differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml deleted file mode 100644 index 66b5216d53d6..000000000000 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml.cs deleted file mode 100644 index 1fbdaba01440..000000000000 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue8788.xaml.cs +++ /dev/null @@ -1,81 +0,0 @@ -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, - - }, - }; - } - } -} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8788.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8788.cs deleted file mode 100644 index 95f2875306f6..000000000000 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8788.cs +++ /dev/null @@ -1,28 +0,0 @@ -#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 \ No newline at end of file diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png deleted file mode 100644 index 19817a5c81c7..000000000000 Binary files a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png and /dev/null differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png deleted file mode 100644 index 0df686377e6f..000000000000 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShellTabItemsShouldUpdateForDynamicChangesInVisibility.png and /dev/null differ