#9379 closed bug (fixed)
Draggable: position bug in scrollable div
Reported by: | pierrickrouxel | Owned by: | mikesherov |
---|---|---|---|
Priority: | major | Milestone: | 1.11.0 |
Component: | ui.draggable | Version: | 1.10.3 |
Keywords: | regression | Cc: | |
Blocked by: | Blocking: |
Description
When draggable is in scrollable div, the widget doesn't follow the mouse.
Tested with safari and chrome browsers. The bug appears in 1.10.3 version. It is not present in 1.10.2 version !
You can see the bug in this fiddle : http://jsfiddle.net/VPqBp/1/
Change History (12)
comment:1 Changed 10 years ago by
Keywords: | regression added |
---|---|
Status: | new → open |
Summary: | Draggable position bug in scrollable div → Draggable: position bug in scrollable div |
comment:2 follow-up: 3 Changed 10 years ago by
Reduced version of test case from tkhyn in #9315: http://jsfiddle.net/tj_vantoll/c4CDc/
This is not a duplicate as #9315 has been fixed.
comment:3 Changed 10 years ago by
Thanks tj.vantoll, that's indeed the same issue.
For the record and if it can help the future owner of the ticket, here is my comment and a temporary hack as posted on #9315.
The workaround I found is to replace
if (!this.offset.scroll) {
by
if (!this.offset.scroll || scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left) {
in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. The execution is probably even faster if the condition is removed so that
this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
is always executed.Indeed, this.offset.scroll is never updated when the page/container is scrolled (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() in the return statement instead of using the (fixed) values from this.offset.scroll as it is in version 1.10.3.
comment:4 Changed 10 years ago by
Milestone: | none → 1.11.0 |
---|---|
Owner: | set to mikesherov |
Priority: | minor → major |
Status: | open → assigned |
Ugh. Ok, I'll fix this soon as well. I suppose when unraveling spaghetti, you're bound to get some sauce on your shirt.
comment:5 follow-up: 6 Changed 9 years ago by
Is this the cause of the issue seen here? http://jsfiddle.net/mefa/zrNNZ/15/
Draggable elements jump in FF with anything past 1.8.3 Draggable elements jump in Chrome with 1.8.3
Dragging doesn't work :-\
comment:6 follow-up: 7 Changed 9 years ago by
Replying to glebonator:
Is this the cause of the issue seen here? http://jsfiddle.net/mefa/zrNNZ/15/
Draggable elements jump in FF with anything past 1.8.3 Draggable elements jump in Chrome with 1.8.3
Dragging doesn't work :-\
That's #9315, which has already been fixed in master.
comment:7 Changed 9 years ago by
Thanks, copying in both _convertPositionTo() and _generatePosition() from main has fixed my issue.
Replying to tj.vantoll:
Replying to glebonator:
Is this the cause of the issue seen here? http://jsfiddle.net/mefa/zrNNZ/15/
Draggable elements jump in FF with anything past 1.8.3 Draggable elements jump in Chrome with 1.8.3
Dragging doesn't work :-\
That's #9315, which has already been fixed in master.
comment:10 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Draggable: normalize lookups for rootNodes when to bust scroll cache. Fixes #9379 - Draggable: position bug in scrollable div Core: update scrollParent() to support all current supported browsers.
Changeset: 44b2180782df6ef3324789324fcf3f98b85784a0
comment:11 Changed 9 years ago by
Milestone: | 1.11.0 → 1.10.4 |
---|
comment:12 Changed 9 years ago by
Milestone: | 1.10.4 → 1.11.0 |
---|
@mikesherov This isn't going to cherry-pick cleanly into 1-10-stable. You can try to resolve the conflicts, but there were some big changes in draggable that didn't get cherry-picked, so pretty much everything results in a conflict.
This was almost certainly caused by https://github.com/jquery/jquery-ui/commit/a88d64514001867b908776e6bfcfac7f1011970d and is a duplicate of #9315. But I'll leave this open separately since this is a bit different.