Skip to content

[Windows] Fix for FlyoutItem in overflow menu not fully interactable #27575

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 7 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue23803.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -61,4 +59,3 @@ public void TwoMoreControllerDoesNotShowEditButton()
#endif
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
Loading