Skip to content

Conversation

@AneesFathimaS
Copy link

@AneesFathimaS AneesFathimaS commented Nov 19, 2025

Root Cause of the Issue

  1. The platform rootview height is wrong. It gets the height which includes the status bar and navigation bar height.
    With Windowflag as FullScreen the rootview height includes the navigation bar height alone.
  2. In Dismiss() method, we have added a condition as Popup should be closed if StaysOpen is false.
    It was wrong. As per the popup behavior it should be closed when Dismiss() method is called.
  3. When window resizes the popup is positioned before the Screen height and width are updated based on current screen height and width.
  4. In .NET MAUI framework, the SizeChanged event for Shell pages was not invoked. This issue already exists in Framework, But it doesn't occured in SfPopup till .NET9. Due to the .NET10 framework changes, this issue started occurring, causing the popup size to remain incorrect after orientation changes.
  5. Displaying a popup when the page is not yet loaded, while using the page as a direct page and launching the popup during load time.

Description of Change

  1. We have reduced the status bar height and the navigation bar height from the rootview height to get the correct screen height. When FullScreen flag is set, reduced the navbar height alone from the rootview height. Same for landscape mode in width.
  2. In Dismiss() method, we have added a condition as Popup should be closed if StaysOpen is false.
    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.
  3. In the OnPlatformWindowSizeChanged event called the SyncPopupDimensionFields() method where the scrennheight is getting updated and after that called the ResetPopupWidthHeight method so that popup resize based on the current screen height and width.
  4. Added a workaround for .NET 10 by explicitly wiring the SizeChanged event for the current page of the Shell when a popup is opened from a Shell page. This ensures the popup recalculates its size correctly after orientation changes.
    FrameWork Link : Shell SizeChanged event not invoked / Size not set dotnet/maui#7227
  5. When using Shell as Direct Page:
    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

  1. In .net 10 Popup height and position is wrong.
  2. Popup doesn't closed when calling Dismiss() method with StaysOpen as true.
  3. In windows platform when we maximize and minimize the window the popup position is incorrect.
  4. In .NET 10, when a popup is opened via AppShell and the orientation changes from portrait to landscape, the popup size does not update on iOS.
  5. [Android] SfPopup not displayed when IsOpen set to True in XAML at launch

Screenshots

Before and After:

OutputImages.docx

@AneesFathimaS AneesFathimaS changed the title Moved popup changes from dev to toolkit Resolved the Popup Position and Size issue. Nov 19, 2025
Copy link
Contributor

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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants