UXP Modeless Dialog Bug

There seems to be some bugs when trying to display a Modeless Dialog.

Example HTML Dialog used below:

    <dialog
      id="test-dialog"
      style="
        width: 300px; height: 200px; background-color: #333355; color: white; display: flex; flex-direction: column; justify-content: center; align-items: center;"
    >
      <p>Greetings!</p>
      <form method="dialog">
        <button>OK</button>
      </form>
    </dialog>

Modal Example

When displaying a dialog with showModal() or uxpShowModal() it shows up in the proper size when you set the width and height via css or via the parameters.

image

dialog.showModal({
    resize: "none",
    size: {
      width: 300,
      height: 200
    }
  });

or simply

dialog.showModal();

or

dialog.uxpShowModal();

Modeless Example

However, when trying to display it as a modeless dialog we see the following bugs:

  • Resize is always on for horizontal and vertical
  • There is a strange gap on the right and bottom of the panel

that resize is always enabled,

image

Using:

dialog.show({
    resize: "none",
    size: {
      width: 300,
      height: 200
    }
  });

or simply

dialog.show();

@Dirk pointed out that minSize and maxSize can be set to disable resizing, this appears to work, however the right and bottom border bug still is present.

example:

dialog.show({
    resize: "none",
    size: {
      width: 300,
      height: 200,
    },
    minSize: {
      width: 300,
      height: 200,
    },
    maxSize: {
      width: 300,
      height: 200,
    }
  });
1 Like

2 posts were split to a new topic: How to manipulate dialogs?

Try using the argument .dialog.show({ resize: "both", size: { width: 300, height: 200 } });

1 Like