Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#17147 closed defect (wontfix)

dijit/Dialog doesn't resize when the content changes

Reported by: Snopzet Owned by: bill
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.9.0
Keywords: Cc:
Blocked By: Blocking:

Description

The problem is quite simple: if you have a dijit/Dialog and you set the content to a dijit/layout/ContentPane as first element, sizeable elements within this contentPane won't resize the Dialog. This is because the dojo parser puts a fixed width and height for the contentPane. If you initialize the Dialog with a contentPane as content directly, this won't happen.

To work around this issue you can wrap the contentPane in a simple div.

Attachments (1)

test.html (1019 bytes) - added by Snopzet 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Snopzet

Attachment: test.html added

comment:1 Changed 6 years ago by bill

Resolution: wontfix
Status: newclosed

It's true that (for better or worse) ContentPane? based widgets like Dialog have special handling when there's a single layout widget child.

But in addition to the workaround you listed, you can disable that special handling by setting _ContentPaneResizeMixin.doLayout to false.

Note also that directly setting the content of a nested ContentPane? won't work well, because the Dialog won't know to recenter itself.

So, realistically I don't think we want to make any changes in Dialog to support this scenario. Instead you should just set doLayout to false.

comment:2 Changed 6 years ago by bill

Actually I realized that doLayout doesn't work for Dialog, but I'll fixe that for #13750.

I tried your test case but at least on Chrome/mac it's the same behavior for the two buttons, i.e. even without the workaround the Dialog is still sized correctly.

Note: See TracTickets for help on using tickets.