-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows, Catalyst] Fix IsPresented=true Not Working on Initial Value in FlyoutPage #31515
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
Conversation
Hey there @@devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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 issue where setting IsPresented="true"
on a FlyoutPage doesn't open the flyout automatically on app launch for Windows and macOS Catalyst platforms. The fix addresses timing issues where platform views are loaded before XAML properties are applied.
- Delays frame observer connection on macOS Catalyst using DispatchQueue to ensure XAML properties load first
- Adds a Loaded event handler on Windows to apply IsPresented value after platform view is ready
- Includes comprehensive UI tests to validate the fix
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Core/src/Handlers/Window/WindowHandler.iOS.cs |
Conditionally delays frame observer connection for macOS Catalyst using DispatchQueue |
src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Windows.cs |
Adds Loaded event handler to apply IsPresented value after platform view initialization |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31372.cs |
NUnit test to verify flyout is presented on initial load |
src/Controls/tests/TestCases.HostApp/Issues/Issue31372.cs |
UI test page demonstrating FlyoutPage with IsPresented=true |
void OnLoaded(object sender, RoutedEventArgs e) | ||
{ | ||
if (VirtualView is not null) | ||
{ | ||
PlatformView.IsPaneOpen = VirtualView.IsPresented; | ||
} | ||
} |
Copilot
AI
Sep 8, 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 OnLoaded event handler will fire every time the control is loaded, but the IsPresented synchronization only needs to happen once. Consider unsubscribing from the Loaded event after the first execution to avoid unnecessary repeated executions.
Copilot uses AI. Check for mistakes.
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
if (!_intialLayoutFinished) | ||
{ | ||
_intialLayoutFinished = true; | ||
SetInitialPresented(); |
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.
ViewDidAppear()
is much later in the lifecycle. Not a problem, but this could cause a visible delay where the flyout opens after the user sees the page.
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.
@devanathan-vaithiyanathan if you do it via IUIViewLifeCycleEvents does ethat cause less delay?
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.
@PureWeen , PhoneFlyoutPageRenderer is derived from UIViewController, not UIView. Therefore, overriding MovedToWindow isn’t possible, and invoking the MovedToWindow event handler isn’t applicable in this case.
/azp run |
Azure Pipelines successfully started running 3 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.
remove the changes to this file
You can fix this by adding a REMOVE inside the unshipped
or you can use the cake script for this locally
dotnet cake --target=publicapi
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.
@PureWeen , Thanks for the suggestion. I’ve moved the changes from Shipped to Unshipped.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
* [Testing] Fix for flaky UITests CookiesCorrectlyLoadWithMultipleWebViews in CI (#31823) This PR addresses the UI test image failures that occurred in the main branch and includes updates to improve rendering and test stability across platforms. - In the CookiesCorrectlyLoadWithMultipleWebViews test case, I changed the WebView source to match the cookies. ### Test cases: - CookiesCorrectlyLoadWithMultipleWebViews * [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. (#31831) * [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. * changes added. * changed the version condition. * [testing] Update androidApiLevels for device tests (#31827) * Update androidApiLevels for device tests * [ci] Update provisioning of api 36 * Add reference (#31669) * [Windows, Catalyst] Fix IsPresented=true Not Working on Initial Value in FlyoutPage (#31515) * mac fix added * Windows fix added * test case added * Update Issue31372.cs * Update Issue31372.cs * Update WindowHandler.iOS.cs * fix updated * Update WindowHandler.iOS.cs * Update WindowHandler.iOS.cs * Update PublicAPI.Shipped.txt * changes added in UnShipped file * Temporarily disable flaky WebView tests using FlakyTest attribute (#31868) * Initial plan * Temporarily disable flaky WebView tests with FlakyTest attribute Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> * Add tracking issue link to FlakyTest attributes Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> * Invert NavigationPage UseMauiHandler flag (#31859) * Update dependencies from https://github.com/dotnet/xharness build 20251004.2 (#31872) On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 9.0.0-prerelease.25426.1 -> To Version 9.0.0-prerelease.25504.2 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [release/9.0.1xx-sr12] Fix ProjectList not displaying due to missing BindingContext update in template sample (#31954) * update ProjectListPage * Update MauiApp.1.csproj --------- Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> * [release/9.0.1xx-sr12] [Android] -Picker dialog causes crash when page is popped while dialo… (#31919) * [Android] -Picker dialog causes crash when page is popped while dialog is open * removed the dispose call. * Revert "removed the dispose call." This reverts commit e1e7a9f. * removed the dispose call. * Modified with Dismiss() method. --------- Co-authored-by: sheiksyedm <sheiksyedm@syncfusion.com> * [release/9.0.1xx-sr12] [iOS] Fix memory leak in CollectionViewHandler2 ItemsLayout PropertyChanged subscription (#31922) * [release/9.0.1xx-sr12] [Android][Regression] Fixed Entry and Editor AppThemeBinding colors for text and placeholder reset to default on theme change (#31921) * added snapshots and fix * removed test cases * added the test cases and snapshots * added braces * added mac and windows snapshots * added mac and windows snapshots * added snapshot --------- Co-authored-by: TamilarasanSF4853 <tamilarasan.velu@syncfusion.com> * 9.0.120 Release Branding (#31979) * [release/9.0.1xx-sr12] [ci] Update arcade main (#31987) * Update arcade * Don t use internal feeds --------- Co-authored-by: Rui Marinho <me@ruimarinho.net> * Update FlyoutViewHandler.Windows.cs (#32007) Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com> --------- Co-authored-by: TamilarasanSF4853 <tamilarasan.velu@syncfusion.com> Co-authored-by: sheiksyedm <sheiksyedm@syncfusion.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com> Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> Co-authored-by: Tim Miller <drasticactions@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
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!
Issue Details
When setting IsPresented="True" on a FlyoutPage in .NET MAUI , the flyout does not open automatically on app launch as expected.
Description of Change
On macOS, the frame observer connection is delayed using DispatchQueue.MainQueue.DispatchAsync() so XAML properties finish loading before observation starts.
On Windows, PlatformView is loaded before applying the IsPresented value.
Issues Fixed
Fixes #31372
Tested the behavior in the following platforms.