Posted 3 April 2024, 1:32 am EST
Hi Andreas Steidle,
Thank you for your suggestion for the ‘autoCenter’ property. For now, the Popup control has a property named ‘owner’ which sets an owner element for the Popup, after setting this property the Popup position can be controlled by using the ‘position’ property of the Popup. But, when the owner element is not set, then the Popup behaves like dialogs, which are usually centered on the screen. And this is a very rare use case, when there is no owner element for the popup, and it’s position is to be shifted somewhere else other than the center position. Hence, for now, there is no such property available like ‘autoCenter’.
And as per the current Popup structure, when the popup is shown, the popup element is inserted at the top left corner and then shifted to the center of the page through CSS, which is necessary as page size may not be the same each time when the popup appears. So, if we plan to add a property to show the popup at the same position again, we need to store the popup position and shift it to the same position when the popup appears again, which is the same thing that we shared in the solution in our last comment. And showing the popup at the same position again also introduces some unexpected behavior in some situations like, if the popup’s last position is in the bottom right corner of the page, and then the page size is reduced by the user, then when the popup is shown again, it will be shown at the same position again, which may add a scrollbar to the webpage and scroll the page to show the popup.
So, for now, as this is a very rare use case, there are no current plans to add this property to the Popup control.
Regards