Opened 5 years ago

Last modified 3 years ago

#9919 open bug

Dialog resizing doesn't work properly if the dialog contains an iframe

Reported by: Rantanen Owned by: Rantanen
Priority: minor Milestone: none
Component: ui.dialog Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

If the dialog contains an iframe, any drag event that happens on top of the iframe won't be received by the main page.

This was originally reported in #7682 and #7650 and fixed in [a7353e7c9ba18e017813195c885115338800e13d]. The fix works for dragging and for resizing dialogs that do not contain iframes. When the dialog size is changed during resize, the iframe inside it changes size but the overlay div won't match the iframe's size.

This results in two problems:

  1. When the dialog is made larger and smaller during one resize, the mouse will end up on top of the iframe during the latter phase.
  2. When the dialog is made smaller than it was originally, scroll bars appear since the dialog now contains the blocking div which stays the original size. The scroll bars disappear when the blocking div is removed during the _unblockFrames call.

Test case: http://jsbin.com/picaqipi/1/, reproduced at least in Chrome 33

Change History (8)

comment:1 Changed 5 years ago by Scott González

Owner: set to Rantanen
Status: newpending

Do you have a proposal for this other than the expensive operation of changing the size of the div on every move event?

comment:2 Changed 5 years ago by Rantanen

Status: pendingnew

No, not really. That's the only solution I've came up with. How big of a performance issue is that in the end though? We're changing the size of the dialog itself already and in most cases I would expect there to be maximum of one iframe inside the dialog which would increase the amount of divs that need resizing from one to two.

https://github.com/jquery/jquery-ui/pull/1214

Well.. other than inserting massively overlarge div inside the dialog and forcing overflow off to hide the inevitable scrollbars. But to me that sounds even worse.

comment:3 Changed 5 years ago by Rantanen

Actually would it be an option to just create a single full-window sized div over the whole page instead of a seperate div over each iframe? Do we still get drag events for the dialog?

comment:4 Changed 5 years ago by Rantanen

Having a single full-window div seems to work as well at least in current browsers and emulated IE7-10.

https://github.com/jquery/jquery-ui/pull/1215

comment:5 in reply to:  3 ; Changed 5 years ago by Scott González

Replying to Rantanen:

Actually would it be an option to just create a single full-window sized div over the whole page instead of a seperate div over each iframe?

Perhaps during resize, but certainly not during drag.

I'm hesitant to implement either of the suggestions since it would mean moving away from a temporary solution in dialog to a permanent solution in dialog. The code that currently exists will go away with the interaction rewrite.

comment:6 in reply to:  5 ; Changed 5 years ago by Rantanen

Replying to scott.gonzalez:

I'm hesitant to implement either of the suggestions since it would mean moving away from a temporary solution in dialog to a permanent solution in dialog. The code that currently exists will go away with the interaction rewrite.

This is okay. We needed this fix for our own application and I've now implemented it there. With the pull requests I just wanted to make sure that we won't lose the fix when updating jQuery in future.

If the issue will be fixed with the interaction rewrite in future, this is fine by me as well. Is there a target for this rewrite?

comment:7 in reply to:  6 Changed 5 years ago by Scott González

Status: newopen

Replying to Rantanen:

If the issue will be fixed with the interaction rewrite in future, this is fine by me as well. Is there a target for this rewrite?

As of right now, it won't fix it. The solution you see today is taken from the rewrite. The rewrites are planned for 1.13 and progress can be tracked in the interactions branch.

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

#14459 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.