akottr / dragtable

re-order table columns by using drag'n'drop
http://akottr.github.io/dragtable
MIT License
203 stars 166 forks source link

Dragged element is not in the correct position if within a scrollable container which is scrolled #37

Open scriby opened 9 years ago

scriby commented 9 years ago

Here is an example: http://screencast.com/t/OyFtcX87Aj

When the container has been scrolled, the dragged table header appears to be offset to the right by an amount equal to the amount scrolled.

scriby commented 9 years ago

In addition to this, when the drag begins, it seems to scroll the containing element all the way to the left instantly. So, instead of retaining your view of the table where you started dragging, you're jumped back to the beginning of the table.

(Update: I think the reason for this is because the ul is positioned absolutely, it won't get scrolled even though the container itself is scrolled. I think it would need to copy the scrollLeft from the container in order to be positioned correctly.)