Skip to content

[Windows] Fix IsPresented property not updating correctly in FlyoutPage #28471

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

Merged
merged 9 commits into from
Mar 27, 2025

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Mar 18, 2025

Issue Details

The IsPresented property does not update correctly after closing the flyout. Once the flyout is closed, attempting to set IsPresented = true does not reopen it.

Description of Change

Wired the PaneClosed event to ensure the IsPresented property is updated properly. This ensures that the flyout opens and closes as expected when toggled via button click.

Issues Fixed

Fixes #28440

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before After
Windows
Before-Fix.mp4
Windows
After-Fix.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 18, 2025
Copy link
Contributor

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.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Mar 18, 2025
@devanathan-vaithiyanathan devanathan-vaithiyanathan marked this pull request as ready for review March 19, 2025 11:07
@Copilot Copilot AI review requested due to automatic review settings March 19, 2025 11:07
@devanathan-vaithiyanathan devanathan-vaithiyanathan requested a review from a team as a code owner March 19, 2025 11:07
Copy link
Contributor

@Copilot Copilot AI left a 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 the FlyoutPage's IsPresented property was not updating correctly on Windows by wiring the PaneClosed event.

  • Added PaneClosed event handling in the FlyoutViewHandler for Windows.
  • Created a new test case in TestCases.HostApp and an automated UI test in TestCases.Shared.Tests to validate the fix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Controls/tests/TestCases.HostApp/Issues/Issue28440.cs Added new UI for manually testing the flyout state behavior.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28440.cs Introduced an automated UI test ensuring IsPresented state transitions work correctly.
src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Windows.cs Wired the PaneClosed event to correctly update IsPresented when the flyout closes.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

The test FlyoutContentTests is failing on Windows.

   at UITest.Appium.HelperExtensions.Click(IUIElement element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 287
   at UITest.Appium.HelperExtensions.Tap(IApp app, String element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 25
   at Microsoft.Maui.TestCases.Tests.Issues.ShellFlyoutContent.FlyoutContentTests() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContent.cs:line 32
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Could you verify if is related with the changes?

@devanathan-vaithiyanathan
Copy link
Contributor Author

The test FlyoutContentTests is failing on Windows.

   at UITest.Appium.HelperExtensions.Click(IUIElement element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 287
   at UITest.Appium.HelperExtensions.Tap(IApp app, String element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 25
   at Microsoft.Maui.TestCases.Tests.Issues.ShellFlyoutContent.FlyoutContentTests() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContent.cs:line 32
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Could you verify if is related with the changes?

@jsuarezruiz , We couldn't reproduce the failure locally, but I've added a null check to further improve the fix. Let me know if any changes needed

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho added this to the .NET 9 SR6 milestone Mar 27, 2025
@rmarinho rmarinho merged commit de12318 into dotnet:main Mar 27, 2025
128 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-flyoutpage FlyoutPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlyoutPage IsPresented not updated properly in windows
3 participants