Change dialog size

,

From what I understand, UXP dialogs cannot be responsive, so I would like to know how to change the size based on the amount of items displayed. I was thinking media queries of some kind, but is there another way?

My dialog height/widths are currently hard-coded, and it works fine until I add more elements, then they end up overlapping.

Why? I use resizable dialogs and they are responsive the same as panels

To be a pedant; responsive means content adapting to fit a changing frame, whereas you’re asking for the opposite - a frame that fits its content.

You could in theory calculate the width of your content and then use that to change the hard coded width of your dialogue - that would essentially still be a static width dialogue, just one that’s width is dynamically determined before it is rendered. In a similar vein you could calculate the total content width and then change the width of individual elements in your dialogue html to fit.
Both seem rather inelegant solutions to me that probably involve some “magic numbers” which is never great.

Personally I’d reapproach your design from the perspective of having your layout change instead.

1 Like

Ah, I got confused. But TBH I still don’t understand why would anyone need that :thinking:

I mean, if you know the elements inside, you just fix the holder size to fit them.
If elements inside are dynamic, layout should be responsive instead of changing and fixing the holder size.

I assume there also might be issues with fixed size depending on scaling (e.g. if user has 150% or 200% scaling). What happens then? Especially if one uses a combination of both Ps and OS scaling

IMO, unless you’re really sure about all the elements inside and their sizes, holder should not have fixed size at all or if it does, then at least on one side there should be a scroll bar

1 Like

BTW, there’s a topic about this already

1 Like

@Karmalakas @Timothy_Bennett Thank you for your responses and the link to the related topic. I’ll check it out.

1 Like