ShowModal Popup OnResize/OnOrientationChange

Hi,

When it is a popup form neither of these events fire if the orientation is changed on a mobile.

Thanks,

Ken

The main hosting form should receive this.

It does but any changes I make to the popup form's width/height seem to be either ignored or changed afterwards.

All I am trying to do is on a mobile change the popup form height/width to that of the screen if the orientation is changed.

As an aside, is there any reason why setting the popup form's align to alClient does not work as expected?

I have been experimenting with this. When the orientation changes you are not processing the alignment or anchor settings of the components within a popup form. You are processing the WidthPercent and HeightPercent if set to ssPercent.

I cannot see this. When a control (i.e. also TForm), width or height is changed, a realign call is done.

I should have mentioned that this is a PWA.

There is nothing specific for PWA in terms of control positioning, align, anchoring.
If a problem persists, please isolate this and provide a sample source project with which this can be reproduced.

Zip attached. For convenience it can be directly displayed at www.karmobile.net/Test/Index.html.ShowModal.zip (13.7 KB)

When Popup = true, it is supposed to be a fixed size (independent from the browser window size) form. Hence, resize is not happening, it has a fixed size.
If I remove in your code
// PopupForm.Popup:=True;
then it works as expected.

Ah, that explains it. Thank you very much.