For AI agents: the complete documentation index is available at https://gultyayev.github.io/ngx-virtual-dnd/llms.txt, the full documentation bundle is available at https://gultyayev.github.io/ngx-virtual-dnd/llms-full.txt, and this page is available as Markdown at https://gultyayev.github.io/ngx-virtual-dnd/guide/features/auto-scroll.md.

Auto-scroll

While an item is dragged near the edge of a scrollable list, the list scrolls toward that edge. The closer the pointer is to the edge, the faster it scrolls. Auto-scroll is on by default.

<vdnd-sortable-list [autoScrollConfig]="{ threshold: 80, maxSpeed: 20 }" ... />
OptionDefaultMeaning
threshold50Distance from the edge, in px, at which scrolling starts
maxSpeed15Maximum speed, in px per frame at 60 fps
acceleratetrueScroll faster the closer the pointer is to the edge

autoScrollConfig accepts a partial object. Options you leave out keep their defaults.

Where it applies

autoScrollEnabled and autoScrollConfig exist on every scroll container:

  • <vdnd-sortable-list>
  • <vdnd-virtual-scroll>
  • <vdnd-virtual-viewport>
  • vdndDroppable
  • vdndScrollable (page-level and external scroll containers)

When scroll containers are nested, auto-scroll starts with the innermost container under the pointer. Once that container reaches its end, it moves on to the outer one.

Disabling

<vdnd-sortable-list [autoScrollEnabled]="false" ... />