Opened 10 years ago
Last modified 9 years ago
#8961 open bug
Sortable: Intermittently unable to sort while dragging and scrolling
Reported by: | CezarisLT | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.sortable | Version: | 1.9.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
It appliers there seems to be a problem with big scrollable items and overflow:scroll.
Try and move item 1 down to bottom and you will see the placeholder will fail and cannot be dropped, moving it around a bit seems to fix it.
Setting the tolerance to "pointer" seems to half fix this bug.
Change History (6)
comment:2 Changed 10 years ago by
Milestone: | 1.10.0 → none |
---|
comment:3 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | sortable: Strange behaviour on big item and overflow:scroll → Sortable: Intermittently unable to sort while dragging and scrolling |
I don't believe this is caused by #5039 as it has to deal with the page scroll and this is caused by scrolling within a single element.
This also has nothing to do with the size of the items as I can recreate the problem with much smaller ones, here's a reduced test case http://jsfiddle.net/tj_vantoll/Sb4GT/.
The issue is that when you scroll, occasionally when scrolling you have to shake the mouse a bit for it to recognize the new positions of the sortable items. This is most noticeable when scrolling up but occurs in both directions.
comment:4 Changed 9 years ago by
When you scroll and scrollLeft
or scrollTop
of container changes, positions of sortable items (i.e. top
and left
) should be updated as well, otherwise widget is comparing *new* position of mouse pointer with *old* cached positions of sortable items.
In fact, when you are shaking your mouse without scroll, widget refreshes positions of items (https://github.com/jquery/jquery-ui/blob/master/ui/sortable.js#L411 calls _rearrange
, and then this.refreshPositions()
is invoked).
Calling this.refreshPositions(true)
after scroll in _mouseDrag
either eliminates this bug or at least makes it less noticeable: http://jsfiddle.net/Sb4GT/1/
Hi CazarisLT,
Thanks for taking the time to contribute to the jQuery UI project. I can see the issue in your test case. The issue seems to be that the plugin doesn't correctly account for the fact that a scroll has occurred until you move it around a bit.
Therefore, I think this might be a duplicate of #5039. Thoughts? cc mikesherov