Opened 11 years ago

Closed 7 years ago

Last modified 7 years ago

#4066 closed bug (wontfix)

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:

Description

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 :)

Change History (11)

comment:1 Changed 11 years ago by rdworth

Milestone: TBD1.6

comment:2 Changed 11 years ago by rdworth

Milestone: 1.71.8

comment:3 Changed 8 years ago by Jörn Zaefferer

Do we support dialogs with iframes as content?

comment:4 Changed 8 years ago by Scott González

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

comment:5 Changed 8 years ago by Skaffen

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.

See: http://jsfiddle.net/4zTEe/3/

comment:6 Changed 7 years ago by Scott González

Milestone: 1.9.01.10.0

comment:7 Changed 7 years ago by dcarrith

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

comment:8 Changed 7 years ago by dcarrith

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.

comment:9 Changed 7 years ago by Scott González

#9065 is a duplicate of this ticket.

comment:10 Changed 7 years ago by aNt1X

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.

comment:11 Changed 7 years ago by Scott González

_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.

Note: See TracTickets for help on using tickets.