Skip to main content

Search and Top Navigation

#9432 closed bug (invalid)

Opened July 16, 2013 07:27PM UTC

Closed August 01, 2013 08:50AM UTC

Draggable on absolute elements (jQuery.ui 1.10.3) - Bug + fix

Reported by: piratax Owned by: piratax
Priority: minor Milestone: none
Component: ui.draggable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

Line 1584:

this.offsetParent = this.helper.offsetParent();

At start drag if the element is absolute and the page scroll is not 0 (both left and/or top), the element is pushed away for n pixel as the scroll size. This is due to the fact that $.fn.offsetParent() might return the HTML document as ancestor parent.

By stopping the DOM trasversing when parent is document.body the issue disappears.

ie.

this.offsetParent = this.helper.offsetParent();

if(this.offsetParent[0].tagName.toLowerCase() == 'html'){

this.offsetParent = $(document.body);

};

Attachments (0)
Change History (2)

Changed July 17, 2013 12:16PM UTC by tj.vantoll comment:1

owner: → piratax
status: newpending

Hi piratax,

Thanks for taking the time to contribute to the jQuery UI project. Is this the same problem as #9315? If not can you please create a test case that shows the issue you're describing. You can use http://jsfiddle.net/tj_vantoll/fwk8R/ as a starting point.

Changed August 01, 2013 08:50AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!