-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fixed Shell flyout does not disable scrolling when FlyoutVerticalScrollMode is set to Disabled #32734
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
base: main
Are you sure you want to change the base?
Changes from all commits
3ff5551
bd35e52
15763a5
a751aa7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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}" | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| 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 | ||||||
|
||||||
| 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)] | ||||||
|
||||||
| [Category(UITestCategories.FlyoutPage)] | |
| [Category(UITestCategories.Shell)] |
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.
According to the UI Testing Guidelines, MenuItem items in the HostApp test page should have
AutomationIdattributes set for proper test automation. The test tries to locate "Item 1" and "Item 5" viaWaitForElementandScrollDown, but the MenuItems created in the loop don't have AutomationId set. AddAutomationId = $"Item {i}"when creating each MenuItem to ensure the test can properly interact with these elements.