Opened 15 years ago

Closed 15 years ago

Last modified 14 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.5
Component: ui.core 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).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).css('position') != 'static') { 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 (3)

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!

comment:2 Changed 15 years ago by (none)

Milestone: 1.2.2

Milestone 1.2.2 deleted

comment:3 Changed 14 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.