Weird grey space in HtmlDialog between Title and top of content when reopening the dialog

I have been experiencing this weird behaviour in BigSur and Monterey when I close and reopen an HtmlDialog. Sorry, but I cannot upload the screenshot as the forum is not allowing me for some reason.

Anyway, it is very easy to reproduce:

html = <<-SCRIPT
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    hello World!
</body>
</html>
SCRIPT

dialog = UI::HtmlDialog.new(
{
    :dialog_title => "MCTools",
    :preferences_key => "mct_main_app",
    :resizable => true,
    :width => 600,
    :height => 800,
    :style => UI::HtmlDialog::STYLE_DIALOG,
})

dialog.set_html(html)
dialog.show

Now if I close and reopen the dialog in the Ruby console

dialog.close
dialog.show

the weird grey bar appears.

I have tested it on my old mac (BigSur Intel) and the new one (Monterey M1 Pro) and both have the same issues. It does not happen on Windows (from memory, as I do not have access to a Windows machine at the moment)

I have played a bit with the HtmlDialog options, but I could not find a combination that works.

Any idea?

Thanks

I would suspect this meta tag. This is for mobile devices only, BTW, and I do not believe desktop SketchUp can run on any mobile devices, … yet. Meaning that any mobile SketchUp apps do not support Ruby extensions.

Just an FYI, this meta tag is totally unnecessary for UI::HtmlDialog class as it uses the Chromium Embedded Framework on both MacOS and Windows. This was previously only for the old UI::WebDialog class that used the MSIE BrowserControl on Windows.

I have removed both, but the issue is still there.

html = <<-SCRIPT
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    hello World!
</body>
</html>
SCRIPT
dialog = UI::HtmlDialog.new(
{
    :dialog_title => "MCTools",
    :preferences_key => "mct_main_app",
    :resizable => true,
    :width => 600,
    :height => 800,
    :style => UI::HtmlDialog::STYLE_DIALOG,
})
dialog.set_html(html)
dialog.show

Good tip on the second meta tag.

I suggest posting a screen shot of the dialog showing the grey area, and open an issue in the API tracker.

On OSX, you’ll want to re-initialize the HtmlDialog and set the html and action callbacks each time you open it. That should fix this issue and also others that you may not have discovered yet.

3 Likes

Yep, that was it. Thanks!

Can you include screenshot of what you observed please?

I tried, but when I try to paste or upload an image I keep getting this error

Sorry, there was an error uploading that file. Please try again.

This is from my dropbox for now.

1 Like