diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue23803.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue23803.cs new file mode 100644 index 000000000000..2cacd26492fa --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue23803.cs @@ -0,0 +1,40 @@ +namespace Maui.Controls.Sample.Issues +{ + [Issue(IssueTracker.Github, 23803, "FlyoutItem in overflow menu not fully interactable", PlatformAffected.UWP)] + public partial class Issue23803 : TestShell + { + protected override void Init() + { + CreateTabContent(); + } + + private void CreateTabContent() + { + var flyoutItem = new FlyoutItem { Title = "Header" }; + for (int i = 1; i <= 20; i++) + { + var contentPage = new ContentPage + { + Content = new Button + { + Text = $"Button_{i}", + AutomationId = $"Button{i}", + FontSize = 24, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + } + }; + + var shellContent = new ShellContent + { + Title = $"Tab{i}", + Content = contentPage + }; + + flyoutItem.Items.Add(shellContent); + } + this.FlyoutBehavior = FlyoutBehavior.Disabled; + this.Items.Add(flyoutItem); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23803.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23803.cs new file mode 100644 index 000000000000..7aaeea18dc0a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23803.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue23803 : _IssuesUITest + { + public override string Issue => "FlyoutItem in overflow menu not fully interactable"; + + public Issue23803(TestDevice device) + : base(device) + { } + + [Test] + [Category(UITestCategories.Shell)] + public void VerifyClickAroundOverflowMenuItem() + { + App.Tap("More"); +#if WINDOWS + var rect = App.WaitForElement("Tab18").GetRect(); + App.TapCoordinates(rect.X + 80, rect.Y + 15); + App.WaitForElement("Button18"); +#else + App.WaitForElement("Tab6"); + App.Tap("Tab6"); + App.WaitForElement("Button6"); +#endif + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs index 3483ebcdeabc..fbba2bc6d4cc 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6784.cs @@ -1,5 +1,3 @@ -#if TEST_FAILS_ON_WINDOWS // When using App.Tap to interact with tab items which placed in the more section, the action targets the corner of the tabs, Line No 24 -// which doesn't trigger navigation on Windows. Windows requires tapping directly on the tab title text. using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -61,4 +59,3 @@ public void TwoMoreControllerDoesNotShowEditButton() #endif } } -#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/DynamicTabSectionVisibility.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/DynamicTabSectionVisibility.png index 17fa0a9a2e06..ef02289e4b8b 100644 Binary files a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/DynamicTabSectionVisibility.png and b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/DynamicTabSectionVisibility.png differ diff --git a/src/Core/src/Platform/Windows/NavigationViewItemViewModel.cs b/src/Core/src/Platform/Windows/NavigationViewItemViewModel.cs index 1e75aadd1776..1fa08a939541 100644 --- a/src/Core/src/Platform/Windows/NavigationViewItemViewModel.cs +++ b/src/Core/src/Platform/Windows/NavigationViewItemViewModel.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; using WBrush = Microsoft.UI.Xaml.Media.Brush; using WIconElement = Microsoft.UI.Xaml.Controls.IconElement; @@ -110,7 +111,7 @@ public WBrush? Foreground public WBrush? Background { - get => IsSelected ? SelectedBackground : UnselectedBackground; + get => (IsSelected ? SelectedBackground : UnselectedBackground) ?? new SolidColorBrush(Microsoft.UI.Colors.Transparent); //The Background color is set to null since both SelectedBackground and UnselectedBackground return null. Adding a default transparent background ensures it is never null, preventing rendering inconsistencies. } public object? Data