Opened 13 years ago

Closed 13 years ago

Last modified 11 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:

Description

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 (3)

comment:1 Changed 13 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 12 years ago by (none)

Milestone: 1.2.2

Milestone 1.2.2 deleted

comment:3 Changed 11 years ago by paul

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