Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#4470 closed enhancement (duplicate)

Dialog is not centered after resizing the window

Reported by: guest Owned by:
Priority: high Milestone: 1.2
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


I opened dialog from page, then I tried to resize the browser window. In Dojo 0.4.3, the dialog window followed the new bounds of window and became centered after resizing. In Dojo 0.9, the dialog window remains at the same place.

Change History (9)

comment:1 in reply to:  description Changed 12 years ago by guest

It's the default behaviour by design, I think.
Add this code to the test_Dialog.html after the dojo.require("dojo.parser");


dojo.connect(window, "onresize", dijit.byId("dialog1"), dijit.byId("dialog1").layout);




comment:2 Changed 12 years ago by bill

Resolution: wontfix
Status: newclosed

Right, this is by design. Since you can move the dialog, users might not want it to be recentered. Pluswhich I feel this is an uncommon case so it doesn't warrant special handling code.

comment:3 Changed 12 years ago by dante

Milestone: 1.0
Resolution: wontfix
Status: closedreopened


i'm reopening this to address again. onResize is very common. onScroll we re-center the dialog (only because we're being lazy and letting _position center on viewport) so it's a non-issue to allow the dialog to center on other "viewport changing" events. (just call _position() again) ... i would argue that it is more the case that a user would want the dialog to remain positioned on both events (or neither, i suppose). either way, the behavior is inconsistant. "since you can move the dialog, users might not want it re-centered on scroll", as well.

comment:4 Changed 12 years ago by itorrey

I think that by default it should re-center on window change (scroll or resize) however is it possible to pass a param in to turn that off if the author doesn't wish for that behavior? Is it also possible to disable the re-centering if the user moves the dialog manually? If so that would also be ideal. I think that if a user is moving the dialog they are doing it for a reason so moving it on them automatically on scroll or resize would be frustrating to the user.

comment:5 Changed 12 years ago by dante

Type: defectenhancement

@itorrey: there are no options to be passed to dialog, aside from title.

a couple options might be nice: non-modal (don't show underlay, block screen) which is essentially a floatingpane i suppose, so may be a little esoteric.

position onScroll+onResize on
off? I would say onScroll it should always position itself in the viewport where it was in the viewport (either centered/untouched, or some other top/left abs position, in the event the drag + scroll)

maybe optional closeable? eg: a "ConfirmationDialog?" substitue, so you can prompt or alert a user and require them to input (other than clicking an X)

changing to 'enchancement' because this is UI change ideas, really.

comment:6 Changed 12 years ago by bill

Milestone: 1.02.0

comment:7 Changed 11 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:8 Changed 11 years ago by bill

Resolution: duplicate
Status: reopenedclosed

Closing this in favor of #6502.

comment:9 Changed 11 years ago by bill

Milestone: 1.31.2
Note: See TracTickets for help on using tickets.