[SOLVED] V3 Initial dialog modal is not in the middle of the screen

Here is my dialog that works just fine:

      var userMessage = myApp.dialog.create({
        title: title,
        text: message,
        buttons: [
        {
            text: 'Got it!',
            onClick: function() {
                myApp.dialog.close();
                if(func){
                    func();
                }
            }
        },      
        ]
    }).open();

However, the very first time it is created it is at the bottom of the screen. I notice that on the element is margin-top -80px. Now if I refresh my page and trigger the dialog again its in the middle with margin-top: -193px. Then all is fine until I clear my cache then the very first dialog is at the bottom again. Any thoughts on why this is happening?

Make sure you call it when app initialized and styles are loaded

The app is initialized and styles are loaded. To test I started the app, let it load, then in my console I ran the function that triggers the dialog and it was still near the bottom.

That is because of image, set this image height

1 Like

Awesome thanks, that was it!