Skip to content

Auto Scroll

makeAutoScroll automatically scrolls a container when the drag overlay center approaches its edges.

Demo

Drag an item near the top or bottom edge of the list to trigger auto-scroll.

Source

What's used

  • ScrollListmakeDroppable + makeAutoScroll(ref, { threshold: 60, speed: 1.5 }) on the same element. The container border highlights when isScrolling is true.
  • SortItemmakeDraggable with [index, items] payload; shows placement indicators on isDragOver.
  • suggestSort('vertical') — reorders items on drop.

Released under the MIT License.