Item12632: error in upstream ui-draggable using firefox
Priority: Urgent
Current State: Closed
Released In: 1.1.9
Target Release: patch
Applies To: Extension
Component: JQueryPlugin
Branches: Release01x01
The offset of a draggable element is wrong using firefox. So when scrolling down a page and grabbing a draggable element the element suddenly jumbs down, i.e. it does not stick to the mouse pointer.
That's because firefox reports an additional scroll offset to the top of the document where chrome does not.
Actually firefox is right in doing so, but the rest of the maths in this module don't seem to account for it ... as far as I read the code.
--- pub/System/JQueryPlugin/ui/jquery.ui.draggable.js (revision 17040)
+++ pub/System/JQueryPlugin/ui/jquery.ui.draggable.js (working copy)
@@ -534,7 +534,7 @@
this.offset.click.top - // Click offset (relative to the element)
this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
- ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top )
+ ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : 0 /*this.offset.scroll.top*/ ) /* chrome returns a zero, firefox the correct scroll.top ... which however disturbs the arithmetics */
),
left: (
pageX -
--
MichaelDaum - 05 Nov 2013