Dialog element bugged?

Since few latest Photoshop versions I’m having a small bug in my dialog windows, I try to put the background in a solid color but seems there’s some margin or padding, these are my settings:

const dialog = document.createElement('dialog');
document.body.appendChild(dialog);
dialog.style.width = "150px";
dialog.style.height = "200px";
dialog.style.backgroundColor = "#111111";

await dialog.uxpShowModal({
    title: "MyPlugin",
    resize: "none"
});

And I cannot find a way to fill the whole dialog window with that color. Is this a bug or what is happening or I’m doing something wrong? It suddenly happen with new PS versions, It wasn’t like this before.

It sounds like you’re encountering an issue with the dialog’s background not filling the entire area due to default margins or padding that may have been introduced in the latest versions of Photoshop.

To address this, you can try setting the margin and padding of the dialog to zero. Here’s how you can modify your code:

const dialog = document.createElement('dialog');
document.body.appendChild(dialog);
dialog.style.width = "150px";
dialog.style.height = "200px";
dialog.style.backgroundColor = "#111111";
dialog.style.margin = "0"; // Remove any default margin
dialog.style.padding = "0"; // Remove any default padding

await dialog.uxpShowModal({
    title: "MyPlugin",
    resize: "none"
});

By explicitly setting the margin and padding to 0, you should be able to achieve a solid color background that fills the entire dialog window. If the issue persists, you might want to check if there are any other CSS rules being applied to the dialog element that could be affecting its appearance.

1 Like

I’ve been using it for some time: show({title: "dialog",resize: "both",}); there is no aberration

1 Like

This doesn’t work somewhow but changing the properties to “both” as @Ancelmoa mentioned makes the trick, I need only to fix maxWidth and maxheight to make it work, thanks!

The problem now is that my window used to be dinamically sized, with this approach I cannot do it unless I have a fixed values.

I’ve just given up on trying to use fixed size modal dialogs because of issues with display scaling on Windows.

Windows display scaling messes up plugin dialogs

1 Like

Does any at adobe have news about if this is going to be fixed or why is happening in new PS versions? It messes up a little my UI design in dialogs and I’m trying to find a solution for this better than sticking to a bug which can lead to future mess.