Skip to main content

Search and Top Navigation

#4066 closed bug (wontfix)

Opened February 05, 2009 12:40PM UTC

Closed October 15, 2012 05:36PM UTC

Last modified February 07, 2013 12:53PM UTC

Dialog: Using iframe as dialog content leads to sizing problems in FF3

Reported by: Skaffen Owned by:
Priority: minor Milestone: 1.10.0
Component: ui.dialog Version: 1.6rc6
Keywords: Cc:
Blocked by: Blocking:

If you make an iframe into a dialog with a width being specified for the dialog then the iframe's width will be wrong. It used to work ok under jquery ui 1.5.

The reason for this, I think, is that the dialog code now sets the width of the content to "auto". Under FF3 an iframe given a width of "auto" just sizes itself as if it had no size specified (i.e. it goes to the default size for an iframe under FF3, which I think is 300px). I think it worked under jq-ui 1.5 as 1.5 would always calculate what to set the content width to based on the dialog width plus the margins.

Additionally with this sizing problem if the dialog is resizable and I then resize it the width of the iframe is altered as the dialog's width changes but it's altered by the amount the dialog is resized, so its width will always be off by the same amount.

I've logged this as a bug - however it may be that jquery-ui considers using dialog with an iframe to be unsupported :)

Attachments (0)
Change History (11)

Changed February 07, 2009 01:37AM UTC by rdworth comment:1

milestone: TBD1.6

Changed March 08, 2009 02:37PM UTC by rdworth comment:2

milestone: 1.71.8

Changed February 27, 2012 04:03PM UTC by jzaefferer comment:3

Do we support dialogs with iframes as content?

Changed February 27, 2012 04:04PM UTC by scottgonzalez comment:4

Let's figure out what the limitations are and then make a decision. Is this still a problem in newer Firefox?

Changed March 23, 2012 10:39AM UTC by Skaffen comment:5

Still behaves the same way - also in Chrome (and probably IE). As before it seems to be that setting a style="width: auto" on the iframe results in it adopting a default size rather than filling the dialog outer.


Changed October 11, 2012 02:47PM UTC by scottgonzalez comment:6


Changed October 15, 2012 04:08PM UTC by dcarrith comment:7

summary: Using iframe as dialog content leads to sizing problems under FF3Dialog: Using iframe as dialog content leads to sizing problems in FF3

Changed October 15, 2012 05:36PM UTC by dcarrith comment:8

resolution: → wontfix
status: newclosed

In the jsfiddle example above, Skaffen is giving the iframe an id="foo" and then calling the dialog on the iframe itself. The outer div is what should be assigned the id="foo". Setting width:auto on an <iframe> doesn't work in general. But, you can just give the iframe a width:100% and it will fill into the space allocated for the dialog. it would be too cumbersome/ugly to try and automatically work around the iframe width:auto limitation in the jqueryui library.

Changed February 06, 2013 04:25PM UTC by scottgonzalez comment:9

#9065 is a duplicate of this ticket.

Changed February 07, 2013 09:25AM UTC by aNt1X comment:10

Are you sure this not a jQuery ui bug?

I mean, the _size() function is overwriting the CSS settings. If you set width=100% via CSS or to the iframe itself, this will be overwritten by the _size() function.

I think that it is better if the dialog preserves the content settings.

Changed February 07, 2013 12:53PM UTC by scottgonzalez comment:11

_size() is doing what it's intended to do. Dialogs are not designed for the main content element to be anything that doesn't support auto sizing. Please read comment:8.