Opened 5 years ago

Last modified 3 years ago

#18259 new defect

dijit/Dialog#resize after show does not take viewport into consideration

Reported by: tupton Owned by:
Priority: undecided Milestone: 1.15
Component: Dijit Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

If you resize a minimally-sized dialog (i.e. with a single word of content) a) while it is shown, and b) after replacing the content with something much bigger that would make the dialog take up its maximum-allowed size, the dialog resizes but does *not* reposition in the middle of the screen.

You can see an example of this in this fiddle, which is probably much clearer than the above description.

Change History (8)

comment:1 Changed 5 years ago by bill

That's what the _position() method is for... Hmm, resize() calls _position() sometimes, but not in this case. I guess it should.

comment:2 Changed 5 years ago by tupton

Note that this is specifically related to *changing* the content of the dialog; if you replace the content with, e.g. set('content', ...), it works as expected.

comment:3 Changed 5 years ago by tupton

That's what the _position() method is for...

Yeah, _position is the workaround that we went with for now, but I get the feeling that _position is private for a reason.

Last edited 5 years ago by tupton (previous) (diff)

comment:4 Changed 5 years ago by bill

Note that this is specifically related to *changing* the content of the dialog; if you replace the content with, e.g. set('content', ...), it works as expected.

But, set('content', ...) is how you are supposed to change the content of the dialog.

comment:5 Changed 5 years ago by tupton

But, set('content', ...) is how you are supposed to change the content of the dialog.

In the particular case that we ran into this in, the content of a dialog is a widget whose content gets populated asynchronously and results in the widget changing its size. It seems a weird workaround to have to completely remove and replace that widget after it populates. Is that the expected way to deal with that situation?

comment:6 Changed 5 years ago by bill

There's just no official support for that... you need to do some kind of workaround like calling set("content", ...) or calling resize() [and _position()].

Anyway, I can look at refactoring things so resize() always calls _position() or something like that.

comment:7 Changed 4 years ago by dylan

Milestone: tbd1.12

comment:8 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.