Maui
Maui copied to clipboard
[Bug] Popup being dismissed when window is resized or loses focus
Description
Despite the following: CanBeDismissedByTappingOutsideOfPopup="False"
The popup is still being dismissed when the window is resized or it loses focus.
Steps to Reproduce
- Create a popup, set CanBeDismissedByTappingOutsideOfPopup to false
- Run app on Windows machine
- Open popup
- Resize window or click on another window to change focus
Expected Behavior
Expect the popup to not be dismissed
Actual Behavior
Popup is dismissed
Basic Information
-
Version with issue: 8.0.0-preview3
-
IDE: VS2022 Preview
-
Platform Target Frameworks:
- UWP: 10.0.19041
That is how the platform component (Flyout) works.
Then perhaps a popup isn't the control I need for my use case. When using it as an edit form, the possibility of it being dismissed is not ideal.
Thanks.
@pictos can we use this platform control instead https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.primitives.popup?view=winui-3.0
@mjfara, we still have some time before code freeze and GA. Thank you for your interest in MAUI Community Toolkit
The control you linked is what I am used to on UWP, very similar functionality but would remain visible even on resize. In the past I had to subscribe to the window resize event in order to re-locate the popup on resize, if that can be built in, even better :)
Flyout is nice though as it can appear above a control.
I think these have 2 different use cases.
yes, we try to get the best options of 2 controls and apply them in one popup. hope we won't need to create custom UserControl
@pictos can we use this platform control instead https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.primitives.popup?view=winui-3.0
@mjfara, we still have some time before code freeze and GA. Thank you for your interest in MAUI Community Toolkit
I'm not sure... We need to check the APIs, from the docs that you linked looks like the Flyout is more powerful (?)
Flyout works great until you switch to another window. An example of Flyout is Windows 11 Widgets:
This window is not resizable and automatically hides when it loses focus.
Any update on this? I am seeing this issue still
I noticed that the Popup is not cleanly being dismissed, it just disappears. It does not trigger the OnClosed handlers but some cleanup seems to be done. I am not sure if the user code can properly handle this unexpected closing. A side effect of this is that if the user code programmatically closes the modal (after a timeout), it crashes into a NullReferenceException during cleanup.
Reproduction sample: https://github.com/peterjgould/PopupResize.git https://github.com/SunshineSpring666/PopupCloseBug.git