-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fix FlyoutPage CollapsedPaneWidth is not working #33786
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?
[Windows] Fix FlyoutPage CollapsedPaneWidth is not working #33786
Conversation
|
/azp run maui-pr-uitests |
|
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 the FlyoutPage CollapsedPaneWidth property on Windows by implementing proper mapping from the MAUI property to the native NavigationView.CompactPaneLength property. The fix enables both initial and dynamic configuration of the collapsed pane width when using CollapseStyle.Partial.
Changes:
- Added property change callback to trigger handler updates when CollapsedPaneWidth changes
- Registered mapper for CollapsedPaneWidth property in FlyoutPage handler
- Implemented mapper to apply CollapsedPaneWidth to native NavigationView.CompactPaneLength
- Added UI test to verify CollapsedPaneWidth works both initially and when changed dynamically
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Controls/src/Core/PlatformConfiguration/WindowsSpecific/FlyoutPage.cs | Added property changed callback (OnCollapsedPaneWidthChanged) to trigger handler updates when CollapsedPaneWidth property changes |
| src/Controls/src/Core/FlyoutPage/FlyoutPage.Mapper.cs | Registered mapper for CollapsedPaneWidthProperty and implemented MapCollapsedPaneWidth to apply the value to NavigationView.CompactPaneLength |
| src/Controls/tests/TestCases.HostApp/Issues/Issue33785.cs | Created UI test page that demonstrates CollapsedPaneWidth functionality with initial value (50) and dynamic change (100) |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33785.cs | Implemented automated UI test that verifies CollapsedPaneWidth changes are applied correctly using screenshot verification |
| if (view is BindableObject bindable && handler.PlatformView is Microsoft.Maui.Platform.RootNavigationView navigationView) | ||
| { | ||
| var collapsedPaneWidth = PlatformConfiguration.WindowsSpecific.FlyoutPage.GetCollapsedPaneWidth(bindable); | ||
| if (collapsedPaneWidth > 0) |
Copilot
AI
Jan 30, 2026
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 validation condition if (collapsedPaneWidth > 0) is inconsistent with the property's validation which allows values >= 0. A value of 0 is valid according to the BindableProperty definition (line 70 in FlyoutPage.cs), but this mapper would skip applying it. Consider changing the condition to >= 0 or removing it entirely since the property already validates non-negative values. The default value is 48, so the typical case of 0 would represent "use default" behavior, which should probably still be applied to the platform control.
| if (collapsedPaneWidth > 0) | |
| if (collapsedPaneWidth >= 0) |
Issue Details
The CollapsedPaneWidth value was not being properly applied to the native NavigationView.
Description of Change
Implemented the logic to apply CollapsedPaneWidth in the FlyoutPageHandler for Windows. Ensured that the specified CollapsedPaneWidth is mapped and assigned to the corresponding property (NavigationView.CompactPaneLength) of the native control.
Note : FlyoutPage CollapsableStyle issue was resolved in PR #29927
Issues Fixed
Fixes #33785
Tested the behavior in the following platforms.
Before.mp4
After.mp4