Wire pragmatic-dnd's auto-scroll on a scrollable container. While any pragmatic-dnd drag
is in flight, hovering near the edges of the registered element scrolls the container
automatically. Pair with OrderedList.Viewport (or any caller-owned ScrollArea) so long
lists can be reordered without manually scrolling first.
autoScrollForElements is global — it activates on every drag regardless of which list
started it — so it's safe to register one element per scroll surface.
Returns a callback ref so the registration fires as soon as the element attaches and the
cleanup fires when it detaches; React doesn't re-run effects on mutable ref.current
changes, so a plain useEffect on a useRef would miss late-mounting elements entirely.
Wire pragmatic-dnd's auto-scroll on a scrollable container. While any pragmatic-dnd drag is in flight, hovering near the edges of the registered element scrolls the container automatically. Pair with
OrderedList.Viewport(or any caller-owned ScrollArea) so long lists can be reordered without manually scrolling first.autoScrollForElementsis global — it activates on every drag regardless of which list started it — so it's safe to register one element per scroll surface.Returns a callback ref so the registration fires as soon as the element attaches and the cleanup fires when it detaches; React doesn't re-run effects on mutable
ref.currentchanges, so a plainuseEffecton auseRefwould miss late-mounting elements entirely.