Skip to main content

Search and Top Navigation

#4631 closed bug (fixed)

Opened June 24, 2009 05:21AM UTC

Closed February 04, 2010 09:52PM UTC

Last modified May 16, 2010 03:23PM UTC

Draggable: Fixed positions include wrong scroll offset in Safari 4

Reported by: attaboy Owned by:
Priority: critical Milestone: 1.8
Component: ui.draggable Version: 1.7.2
Keywords: draggable fixed position scroll offset safari Cc:
Blocked by: Blocking:
Description

This re-opens bug #4142.

Safari 4 fixed the bug that this fix worked around, and as a result, fixed position scroll offsets are now wrong in Safari 4. (Ah, the joys of browsers.)

I have devised a simple patch which checks the Webkit version number before using the old workaround. Webkit 526 and higher is equivalent to Safari 4.

Basically, for tests like:

$.browser.safari && this.cssPosition == 'fixed'

The code would become:

$.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed'
Attachments (1)
  • draggable-4631.diff (4.5 KB) - added by alexch September 26, 2009 12:05AM UTC.

    revised patch for draggable.js

Change History (8)

Changed July 09, 2009 02:19PM UTC by jzaefferer comment:1

milestone: TBD1.8

Changed July 09, 2009 05:38PM UTC by scottgonzalez comment:2

We should remove the browser check and actually do feature detection.

Changed July 09, 2009 07:03PM UTC by jzaefferer comment:3

Whats the feature here, and how can we detect it?

Changed August 21, 2009 02:00PM UTC by paul comment:4

Changed September 25, 2009 12:18AM UTC by alexch comment:5

That URL has two "Fixed" elements inside scrolling divs but neither one is even visible on the screen in Safari 4! No wonder you can't reproduce it! :-)

Just make a position:fixed div on a page with a bunch of other items halfway down a page, shrink the window so the scrollbar appears on the main window, scroll down a bit, then start dragging the div. You'll see it jump around spastically.

Changed September 25, 2009 12:42AM UTC by alexch comment:6

I patched my copy and did some DRYing out of the relevant code as well. It's much clearer now that 4 nearly-identical nested-ternary-operator statements are replaced with some function calls.

Changed February 04, 2010 09:52PM UTC by scottgonzalez comment:7

resolution: → fixed
status: newclosed

Fixed in r3778. Now with even more browser detection! :-(

Changed February 04, 2010 10:02PM UTC by scottgonzalez comment:8

Replying to [comment:3 joern.zaefferer]:

Whats the feature here, and how can we detect it?

The feature is whether or not we can determine the offset correctly for fixed position elements. You can create a fixed position element, position it, get the offset and determine if the value is correct.