Opened 12 years ago

Closed 11 years ago

#7983 closed bug (duplicate)

Draggables do not properly account for scrollHeight in Firefox 8 or 9.

Reported by: nathanhammond Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.draggable Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:


Reduced test case:

Platform: Mac OS X 10.6.8 Affected Browsers: Firefox 8.0.1, Firefox 9.0.1

Reproduction steps:

  1. Load the test case in Firefox for Mac. (file:// protocol is fine)
  2. Scroll down.
  3. Click and drag any "tile."
  4. Note that the tile jumps upward by page's scrollHeight.

The bug is caused by this CSS declaration: html { overflow-y: scroll; }

Removing that style rule eliminates the jump. However, that is a style rule that is pretty well considered best practice (forcing a vertical scroll bar) evidenced by its inclusion in H5BP.

Change History (5)

comment:1 Changed 12 years ago by nathanhammond

I've tracked down the issue as far as the first call to this._generatePosition(event) in the draggable module returning a negative value for top that is equivalent to: -

The value by which Firefox is incorrect is the result of math occurring with those two values.

comment:2 Changed 12 years ago by nathanhammond

Tracked it down to a single issue:

( scrollIsRootNode ? 0 : scroll.scrollTop() )

This appears inside the _generatePosition function in the return object.

scrollIsRootNode evaluates to true, but we want the value for scroll.scrollTop() to be returned in Firefox instead of 0.

Proposed change:

( scrollIsRootNode && !$.browser.mozilla ? 0 : scroll.scrollTop() )

I don't know the full impact of making that change, but it resolves this bug.

comment:3 Changed 11 years ago by chris_staite

I think this is the same issue I had. The issue was with the scrollParent function. In Firefox 11 (maybe earlier?), it needs to operate like it does in MSIE. I modified the scrollParent function if statement from

if ($.browser.msie


if (($.browser.msie || ($.browser.mozilla && $.browser.version == "11.0"))

This fixes it in Firefox, the version testing needs to be performed. Also, it might break other things, but I don't know.

Last edited 11 years ago by chris_staite (previous) (diff)

comment:4 Changed 11 years ago by Scott González


comment:5 Changed 11 years ago by mikesherov

Resolution: duplicate
Status: newclosed

Duplicate of #5718.

Note: See TracTickets for help on using tickets.