Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9594 closed bug (duplicate)

Draggable: Jumps with relative/absolutely positioned iframe

Reported by: eithed Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.draggable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

Hi there,

I've tried using the draggable within an iframe, but unfortunately the positioning of the dragged element is offset, rendering it pretty much useless.

Please find the test case here: http://jsfiddle.net/bF6gf/

Another issue occurs, if the iframe is scrolled, which can be replicated here: http://jsfiddle.net/VpxVp/

  1. drag the draggable element somewhere within the frame
  2. scroll the frame
  3. try dragging the element again

Tested under Chrome.

A possible solution is to use cursorAt and set it to the values of offset / scroll, though such solution seems hackish.

Cheers!

Change History (7)

comment:1 Changed 7 years ago by tj.vantoll

Status: newopen
Summary: draggable position bugged within iframeDraggable: Jumps with relative/absolutely positioned iframe

Reduced: http://jsfiddle.net/tj_vantoll/fScJH/

This is only an issue when the <iframe> is positioned. I'm more concerned by the fact this use case completely fails in master; I'll create a separate ticket for that.

comment:2 Changed 7 years ago by tj.vantoll

Milestone: none1.11.0
Resolution: fixed
Status: openclosed

I was mistaken. We only support creating widgets within iframes; we do not support creating widgets in one window and moving them to another.

Relatively positioned iframes are a problem in 1.10.3, but that issues has been fixed in master - http://jsfiddle.net/tj_vantoll/fScJH/. That fix will go out with 1.11.

comment:3 Changed 7 years ago by tj.vantoll

Resolution: fixed
Status: closedreopened

comment:4 Changed 7 years ago by tj.vantoll

Resolution: duplicate
Status: reopenedclosed

Duplicate of #5727.

comment:5 Changed 7 years ago by eithed

Thank you very much! It seems that both issues are indeed fixed with the git version. Can you please however note that the iframeFix cannot be used (I can't find the list of changes of 1.11, so don't know if it's being deprecated, either way - just a heads up).

I couldn't understand the note about moving widgets though - and as long as there's support for creating widgets within iframes, I'm fine with that ;)

comment:6 in reply to:  5 ; Changed 7 years ago by tj.vantoll

Replying to eithed:

Thank you very much! It seems that both issues are indeed fixed with the git version. Can you please however note that the iframeFix cannot be used (I can't find the list of changes of 1.11, so don't know if it's being deprecated, either way - just a heads up).

iframeFix is intended to allow elements to be dragged on top of iframes, not allow elements within iframes to be dragged.

I couldn't understand the note about moving widgets though - and as long as there's support for creating widgets within iframes, I'm fine with that ;)

We do not support creating widgets and then moving them to different windows.

comment:7 in reply to:  6 Changed 7 years ago by eithed

Replying to tj.vantoll:

iframeFix is intended to allow elements to be dragged on top of iframes, not allow elements within iframes to be dragged.

Ah, that explains the current behavior, though that means then that the behavior from the fiddled version is wrong (in that aspect). Either way the behavior of this attribute becomes inconsistent between versions.

We do not support creating widgets and then moving them to different windows.

But that's not happening here? Unless I'm missing something, the draggable widget is created within the iframe, with the script scope of parent window. There should be no dragging between the windows, yes, and that's fine :)

Note: See TracTickets for help on using tickets.