Bug Tracker

Opened 15 years ago

Closed 15 years ago

#2052 closed bug (fixed)

UI mouse.js does not recognise parent with fixed position

Reported by: wizzud Owned by:
Priority: major Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: ui mouse fixed position Cc:
Blocked by: Blocking:


Line 144 (approx) tests for a parent of relative or absolute position...

if(cp.style && ($(cp).css('position') == 'relative'
$(cp).css('position') == 'absolute')) {

This causes problems in IE7 (standards mode) when dragging an element that has a fixed-position parent and the page is scrolled - the dragged element immediately jumps down by the amount of the page scroll. I fixed this - with no apparent(!) detrimental effect on FF, Opera or IE quirks (Windows only) - by modifying line 144 to read...

if(cp.style && $(cp).css('position') != 'static') {

...so that it tests for the parent being non-static rather than specifically for relative/absolute.

I should point out that in my case the element being dragged had an *immediate* parent that was fixed; I have not tested cases where the fixed parent was several steps back up the DOM (either with or without an intervening relative/absolute parent).

Change History (1)

comment:1 Changed 15 years ago by paul

Resolution: fixed
Status: newclosed

This is fixed in the new rewritten code that will be released with the next version of jQuery UI. Thanks!

Note: See TracTickets for help on using tickets.