Dialog Top and left

In Web2. All dialogs are centered and X pixels from the top. Perhaps bootstrap is forcing this.

I have an internal web app where the user have 36" monitors. And a dialog popping up in the top center makes little sense.

Anyone know if you can hack the CSS to move the Dialog by setting top and left? (Or any other way for that matter)

Modify your bootstrap theme? Web2 users are now required to know CSS. Web1 tried to hide the details.

Yea. I agree with your sentiment. And I have had the ‘discussion’ with the the powers that be at Xojo. But I can’t wait for 2023 r1 or probably later. I need a fix now.

On the bright side I like how Ricardo is fixing things that were previously considered “not a bug”.

1 Like

To change all dialogs to the same position you can add to App HTML Header:

<style>
.modal-dialog {
   position: absolute;
   top:150px;
   left:150px;
}
</style>

If you want to set each dialog, this seems to work correctly (at least right now)
App HTML Header

<style>
.modal-dialog {
   position: absolute;
}
</style>

WebDialog1 Opening event:

//add top left
ExecuteJavascript( "$('#" + me.ControlID + "_modal').css({'top': '150px', 'left': '150px'});" )

If you want to use the same dialog but change the position use the same Style above and use this when you create the dialog:

Var dlg As New WebDialog1
ExecuteJavascript( "$('#" + dlg.ControlID + "_modal').css({'top': '150px', 'left': '150px'});" )
dlg.Show

change the top/left values as needed.

A GIF to show what I get:
dialogtopleft

3 Likes

If you don’t want to alter the App HTML Header you can use:

Var dlg As New WebDialog1
ExecuteJavascript( "$('#" + dlg.ControlID + "_modal div:first').css({'top': '50px', 'left': '50px', 'position': 'absolute'});" )
dlg.Show
1 Like