Dialog height not controllable in PS 25.11?

Hi all, just wondering if any of you have seen any issues with setting modal dialog height in PS 25.11?

I’m seeing the height field ignored in uxpShowModal calls, and resizeTo being a bit flaky.

      const res = await tbDialog.uxpShowModal({
        title: 'SlideMaker',
        resize: 'none',
        size: {
          width: 960,
          height: dialogHt()
        }
      });

They are both fine in 24.2, 25.9.1 and the current beta (I can’t see 25.10 on the available versions to download)

I don’t think height ever worked. I only know it is calculated from its content height and then you cannot change it. Or am I wrong?

I remember reading something along those lines a while back, but it’s been working solidly for me in 24.2 and later.

But, having tested every way I could think of yesterday and it failing in 25.11, I came back to it today and now it’s working.

The only thing I can think of is that something odd happened in the update from 25.10 to 25.11, and that installing 25.9.1 and then re-upgrading 25.9.1 fixed it.

I don’t know if it matters that I’m on 64-bit Windows 11, BTW.

Sorry for wasting people’s time.

Just to capture what I’ve discovered since I posted this one. It does work if you jump through the right hoops. Here are my working guidelines:

  • Setting height on the first time uxpShowModal is called for a specific dialog element works.

  • If the dialog is closed and re-opened and the height in the show call doesn’t match the height of the dialog last time it was shown, then the height in the call is ignored.

  • resizeTo is ignored if the dialog is not fully open. Probably obvious, but I thought it was worth saying. By fully open I mean the mechanics of showing it are complete, which may take tens of ms after the show call. FWIW I use an event listener on load which sets the focus to one element and then cycles waiting until activeElement is pointing to that element. I’m sure there are dozens of ways to do that, but this one is working for me.

  • at least the height in resizeTo is still ignored if that’s the only change you make to the dialog at the time. I’m pretty sure that PS collects html changes and then applies a group together for efficiency, like most browsers do. resizeTo is only applied if there are enough other changes on the list already to trigger a redraw. I don’t have a definitive list of what those must be, but flipping the text value of a label to " " and back is not enough.

There are still some weirdnesses that I can’t explain or control occurring around vertical spacing of elements when the height of a dialog is changed, but they seem to be minor enough that I can ignore them.

1 Like

Sounds complicated…

So if I want to increase the height of my dialog without closing it. Is there a reliable way to do that?

Yes. Make sure you change something else and then call resizeTo.

I was looking at this because I have divs on my dialog that expand and collapse depending on whether they are being used or not. I’m not a big fan of tabs unless you really have enough properties to justify them; they mean that the user doesn’t get a complete overview and tends to miss things. On the other hand I don’t want some of the more complex sections showing unecessarily and scaring people.

So when I expand or collapse a div I call resizeTo immediately after that and it works fine.

FWIW I do the expansion and collapsing by changing the display property of the elements I don’t want inside them, changing element._style.display between 'none' and '' or 'none' and 'flex' depending on the element type.

1 Like

Ok. Thanks. This could help me. I have some searchable dropdowns. When you filter out the list it gets shorter. Once you reopen it then list is tiny and when you reset filter it does not fit. I use popover for this. It is same principle but without dialog title/header.

Of course, it does require that you know what you need to set the dialog dimensions to. That’s why the display scaling issue under Windows display scaling messes up dialogs is such a pain.
Still working on that one!

I’ve given up on Windows display scaling messes up plugin dialogs, which means that I’ve given up on a solution for setting height that’s complete enough to be usable.

Putting this one down as having a correct subject line, the height is not controllable.

1 Like