Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int

var container = new ContainerView(parent.Context, content, MauiContext);
container.MatchWidth = true;

// In Auto or Disabled scroll modes, RecyclerView passes an EXACTLY heightMeasureSpec,
// causing items to be measured to the full RecyclerView height.
// Setting MeasureHeight = true forces UNSPECIFIED mode, allowing items to use their natural height (~48dp).
// This enables RecyclerView to detect when scrolling is needed and to create all required view holders.
if (_shellContext.Shell.FlyoutVerticalScrollMode != ScrollMode.Enabled)
{
container.MeasureHeight = true;
}

container.LayoutParameters = new LP(LP.MatchParent, LP.WrapContent);
linearLayout.AddView(container);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ protected virtual void UpdateFlyoutContent()

_rootView.AddView(_flyoutContentView, index);
UpdateContentPadding();
UpdateVerticalScrollMode();
}


Expand Down Expand Up @@ -929,7 +930,6 @@ public RecyclerViewContainer(Context context) : base(context)
{
SetClipToPadding(false);
SetLayoutManager(_layoutManager = new ScrollLayoutManager(context, (int)Orientation.Vertical, false));
SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false));
}

protected override void Dispose(bool disposing)
Expand Down
52 changes: 52 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32477.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 32477, "[Android] Shell flyout does not disable scrolling when FlyoutVerticalScrollMode is set to Disabled", PlatformAffected.Android)]
public class Issue32477 : TestShell
{
protected override void Init()
{
FlyoutVerticalScrollMode = ScrollMode.Disabled;
FlyoutBehavior = FlyoutBehavior.Locked;
var flyoutItem = new FlyoutItem
{
Title = "Menu"
};

// Add a ShellContent
flyoutItem.Items.Add(new ShellContent
{
Title = "Home",
ContentTemplate = new DataTemplate(typeof(Issue32477ContentPage))
});

// Add FlyoutItem to the Shell
Items.Add(flyoutItem);

// Add MenuItems (static links in flyout)
for (int i = 1; i <= 30; i++)
{
Items.Add(new MenuItem
{
Text = $"Item {i}"
});
Comment on lines +28 to +31
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the UI Testing Guidelines, MenuItem items in the HostApp test page should have AutomationId attributes set for proper test automation. The test tries to locate "Item 1" and "Item 5" via WaitForElement and ScrollDown, but the MenuItems created in the loop don't have AutomationId set. Add AutomationId = $"Item {i}" when creating each MenuItem to ensure the test can properly interact with these elements.

Copilot generated this review using guidance from repository custom instructions.
}
}

class Issue32477ContentPage : ContentPage
{
public Issue32477ContentPage()
{
Content = new StackLayout
{
Children =
{
new Label
{
Text = "The flyout menu items should not be scrollable when the scroll mode is disabled."
}
}
};
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#if TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/32416
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TEST_FAILS_ON_WINDOWS conditional compilation directive with issue #32416 excludes this test from Windows. However, the PR description states the test was validated on Windows (checkbox is checked). Either the conditional directive should be removed if the test now works on Windows, or the PR description should clarify that Windows validation was skipped. Please verify the actual Windows test status and align the code with the description.

Copilot uses AI. Check for mistakes.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue32477 : _IssuesUITest
{
public Issue32477(TestDevice testDevice) : base(testDevice)
{
}
public override string Issue => "[Android] Shell flyout does not disable scrolling when FlyoutVerticalScrollMode is set to Disabled";

[Test]
[Category(UITestCategories.FlyoutPage)]
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test category should be UITestCategories.Shell instead of UITestCategories.FlyoutPage. This test is specifically for Shell flyout behavior, not the FlyoutPage control. The Shell category is more appropriate for Shell-specific functionality.

Suggested change
[Category(UITestCategories.FlyoutPage)]
[Category(UITestCategories.Shell)]

Copilot uses AI. Check for mistakes.
public void VerifyFlyoutVerticalScrollModeDisabledOnAndroid()
{
App.WaitForElement("Item 1");

for (int i = 0; i < 5; i++)
{
App.ScrollDown("Item 5", ScrollStrategy.Gesture);
}

App.WaitForElement("Item 1");
}
}
#endif
Loading