Skip to main content

Search and Top Navigation

#2052 closed bug (fixed)

Opened December 14, 2007 03:34PM UTC

Closed December 27, 2007 01:25PM UTC

Last modified February 26, 2009 11:21AM UTC

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).

Attachments (0)
Change History (3)

Changed December 27, 2007 01:25PM UTC by paul comment:1

resolution: → fixed
status: newclosed

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

Changed May 24, 2008 03:39AM UTC by comment:2

milestone: 1.2.2

Milestone 1.2.2 deleted

Changed February 26, 2009 11:21AM UTC by paul comment:3

milestone: → 1.5