-
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?
Conversation
PR Review: Fix Shell Flyout Scrolling with FlyoutVerticalScrollMode.DisabledSummaryPR correctly fixes Shell flyout scrolling behavior when Code ReviewChanges OverviewFiles Modified:
Technical AnalysisRoot Cause Identification: ✅ Excellent
Fix 1: Remove Duplicate LinearLayoutManager (Line 932) // REMOVED:
SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false));
Fix 2: Set MeasureHeight Flag (ShellFlyoutRecyclerAdapter.cs, lines 147-151) if (_shellContext.Shell.FlyoutVerticalScrollMode != ScrollMode.Enabled)
{
container.MeasureHeight = true;
}
Fix 3: Ensure UpdateVerticalScrollMode is Called (Line 313) UpdateVerticalScrollMode();
Code QualityPositive Aspects:
Suggestions for Improvement: None - the code is clean and well-structured. UI Test ReviewTest Structure: ✅ CorrectHostApp Test Page (Issue32477.cs):
Appium Test (Issue32477.cs):
Test Category: ✅ Appropriate
Test Logic AnalysisThe test verifies:
Potential Edge Cases to Consider:
Platform CoverageTested Platforms (per PR description):
Analysis:
Edge Cases and ScenariosTested Scenarios:
Edge Cases to Consider:
Additional Edge Cases (for future testing):
Breaking ChangesNone - This is a bug fix with no API changes. DocumentationXML Documentation: Not applicable - no public API changes PR Description: ✅ Excellent
Code Comments: ✅ Good
Security & PerformanceSecurity: ✅ No concerns
Performance: ✅ No concerns
Comparison with Existing SolutionsChecked for duplicate PRs: No other open PRs addressing issue #32477 Consistency with iOS Implementation:
Testing ResultsManual Testing: ⏸️ Not performed
Automated Testing: ⏸️ Not run locally
Code Analysis: ✅ Passed
Issues FoundNone All aspects of the PR are correct and well-implemented. RecommendationsFor Merge: ✅ ApproveRationale:
Confidence Level: High
Additional NotesStrengths of this PR:
For Future Enhancements (not blocking):
Checklist
Final Recommendation✅ APPROVE - Ready to merge This PR correctly fixes the Shell flyout scrolling issue with a minimal, well-tested solution. The code is clean, well-documented, and follows all .NET MAUI guidelines. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull Request Overview
This PR fixes an Android-specific issue where the Shell flyout's vertical scroll mode setting (FlyoutVerticalScrollMode = ScrollMode.Disabled) was not being properly respected. The root cause was that a LinearLayoutManager was being assigned after the ScrollLayoutManager, overriding its scroll-control logic.
Key Changes:
- Removed the redundant
LinearLayoutManagerassignment that was overridingScrollLayoutManagersettings - Added
MeasureHeight = trueflag when scroll mode is notEnabled, allowing RecyclerView items to measure at their natural height instead of expanding to full RecyclerView height - Added explicit call to
UpdateVerticalScrollMode()after flyout content updates to ensure scroll settings are applied - Included UI tests to validate that flyout scrolling is properly disabled
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32477.cs |
NUnit test to verify that flyout scrolling is disabled when FlyoutVerticalScrollMode is set to Disabled |
src/Controls/tests/TestCases.HostApp/Issues/Issue32477.cs |
Test page implementation creating a Shell with 30 menu items and disabled vertical scroll mode |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs |
Removed redundant LinearLayoutManager assignment and added UpdateVerticalScrollMode() call |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs |
Added MeasureHeight = true flag for non-Enabled scroll modes to fix item measurement |
| public override string Issue => "[Android] Shell flyout does not disable scrolling when FlyoutVerticalScrollMode is set to Disabled"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.FlyoutPage)] |
Copilot
AI
Nov 20, 2025
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.
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.
| [Category(UITestCategories.FlyoutPage)] | |
| [Category(UITestCategories.Shell)] |
| Items.Add(new MenuItem | ||
| { | ||
| Text = $"Item {i}" | ||
| }); |
Copilot
AI
Nov 20, 2025
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 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.
| @@ -0,0 +1,30 @@ | |||
|
|
|||
| #if TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/32416 | |||
Copilot
AI
Nov 20, 2025
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.
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Root Cause
Description of Change
Validated the behaviour in the following platforms
Issues Fixed
Fixes #32477
Output
Android
32477_issue_android_before.mov
32477_issue_android_after.mov