Skip to main content

Bug Tracker

Side navigation

#2052 closed bug (fixed)

Opened December 14, 2007 03:34PM UTC

Closed December 27, 2007 01:25PM UTC

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

Attachments (0)
Change History (1)

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!