#7925 closed bug (notabug)
droppable prepareOffsets sets incorrect offset when droppable is in an iframe
Reported by: | reevesm | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.droppable | Version: | 1.8.14 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
version: jquery-ui-1.8.14 browser: chrome os: windows
To reproduce:
- Create a draggable element using jQueryUI draggable API outside of your iframe
- Create droppable elements within an iframe (iframe is in middle of the page) on the same page and alert when element is dragged over the droppable within the iframe.
var body = $('#iframe').contents().find('body'); $(body).droppable({
over:function(event,ui) {
alert('over droppable');
}
});
Result: The alert will not fire when dragging over the iframe but will fire when the element is dragged into a position above the iframe
Expected Result: The alert fires when dragging over the body element in the iframe.
See $.ui.ddmanager.prepareOffsets. It appears that m[i].offset is incorrect.
Change History (12)
comment:1 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
I had implemented a workaround to enable drag&drop with iframe. in $.ui.ddmanager.prepareOffsets I change the offset to handle the iframe scrolling & the iframe position.
juste after m[i].offset = m[i].element.offset();
// handle iframe scrolling m[i].offset.top -= m[i].element.parents().find("html,body").scrollTop(); m[i].offset.left -= m[i].element.parents().find("html,body").scrollLeft(); // iframe positioning if( this.current.options.iframeOffset ) { m[i].offset.top += this.current.options.iframeOffset.top; m[i].offset.left += this.current.options.iframeOffset.left; }
where iframe offset come from the draggable option like
$( "div" ).draggable({ iframeFix: true, appendTo: 'body', containment: 'window', helper: "clone", iframeOffset: $("#frame").offset() });
Tested on FF 8.0.1 & Chrome 16
comment:5 Changed 8 years ago by
Replying to scott.gonzalez:
#11204 is a duplicate of this ticket.
Hello scott.gonzalez,
Could you please visit ticket number 11204 its not duplicate of 7925. I still getting issue. when iframe document reloads in IE10.
Please look into it once again and open the ticket.
Thanks Gaurav Teli
comment:6 follow-up: 8 Changed 8 years ago by
Please read the first comment on this ticket and look at the status of the ticket. Regardless of whether this happens to work in Chrome right now, this is not something we support.
comment:8 Changed 8 years ago by
Replying to scott.gonzalez:
Please read the first comment on this ticket and look at the status of the ticket. Regardless of whether this happens to work in Chrome right now, this is not something we support.
Hello Scott.Gonzalez:
I am very much agree with you. I want to say it's working first time as expected. So It should work on 2nd time rendering also.
I am struck in key task. If possible please try to put some focus or guide me.
Thanks Gaurav
We don't support cross-window dragging.