-
Notifications
You must be signed in to change notification settings - Fork 108
Resolved the Popup Position and Size issue. #287
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
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 resolves multiple issues related to popup positioning, sizing, and display behavior in .NET 10 for the Syncfusion MAUI Popup control across Android, iOS, and Windows platforms. The changes primarily address framework-level changes in .NET 10 that affected root view dimensions, event handling, and API deprecations.
Key changes:
- Fixed popup height/width calculations on Android by accounting for system insets (status bar, navigation bar) that are now included in root view dimensions in .NET 10
- Added workaround for .NET 10 Shell page SizeChanged event not triggering on iOS by wiring events to the CurrentPage instead
- Corrected Dismiss() behavior to close popup regardless of StaysOpen property value
- Added deferred popup display logic to handle popups opened during page load with Shell or direct pages
- Suppressed warnings for obsolete APIs in .NET 10 with appropriate pragma directives
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| SfPopupUnitTest.cs | Updated test expectation for Dismiss() behavior with StaysOpen=true |
| SfPopup.iOS.cs | Added Shell.CurrentPage SizeChanged event wiring as workaround for .NET 10 framework issue |
| SfPopup.cs | Fixed Dismiss() logic, added deferred popup display support, switched to SizeChanged for .NET 10, added handler cleanup, made PaddingProperty use 'new' keyword |
| SfPopup.Windows.cs | Corrected order of operations to sync dimensions before resetting popup size |
| PopupMessageView.cs | Added pragma warning suppression for obsolete GetUseSafeArea API |
| PopupHeader.cs | Added pragma warning suppression for obsolete APIs (GetUseSafeArea, IgnoreSafeArea) |
| PopupFooter.cs | Added pragma warning suppression for obsolete APIs (GetUseSafeArea, IgnoreSafeArea) |
| PopupExtension.iOS.cs | Fixed InterfaceOrientation retrieval to use proper API based on iOS version with warning suppression |
| PopupExtension.Android.cs | Added .NET 10-specific inset calculations and fallback logic for screen dimensions and window insets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Root Cause of the Issue
With Windowflag as FullScreen the rootview height includes the navigation bar height alone.
It was wrong. As per the popup behavior it should be closed when Dismiss() method is called.
Description of Change
It was wrong. As per the popup behavior it should be closed when Dismiss() method is called.
So, Removed the condition in the Dismiss() method.
FrameWork Link : Shell SizeChanged event not invoked / Size not set dotnet/maui#7227
Added a condition is DisplayPopup method to defer DisplayPopup until the page is loaded.
When using MainPage as Direct Page:
For MainPage -> the Overlay is added in OnHandlerChanged. But the DisplayPopup method is not called till now, so I called CheckAndOpenDeferredPopup to displayPopup.
[InitializeOverlay called from
• SfPopup.Initialize (Overlay not added)
• OnIsOpenPropertyChanged (Overlay not added)
• OnHandlerChanged (Overlay added here)]
Issues Fixed
Screenshots
Before and After:
OutputImages.docx