Opened 6 years ago

Closed 6 years ago

#9432 closed bug (invalid)

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); };

Change History (2)

comment:1 Changed 6 years ago by tj.vantoll

Owner: set to 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.

comment:2 Changed 6 years ago by trac-o-bot

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!

Note: See TracTickets for help on using tickets.