MCPcopy Create free account
hub / github.com/Effect-TS/effect / clearDrag

Function clearDrag

packages/effect/src/ui/kit/ScrollArea.ts:625–634  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

623 }
624
625 const clearDrag = () => {
626 if (drag === null) return
627 const { axis, pointerId } = drag
628 drag = null
629 stopScrolling(axis)
630 restoreViewportSnap()
631 if (axis.thumb?.hasPointerCapture?.(pointerId) === true) {
632 axis.thumb.releasePointerCapture(pointerId)
633 }
634 }
635
636 const endDrag = (event: PointerEvent) => {
637 if (drag !== null && event.pointerId === drag.pointerId) clearDrag()

Callers 2

endDragFunction · 0.85
syncFunction · 0.85

Calls 2

stopScrollingFunction · 0.85
restoreViewportSnapFunction · 0.85

Tested by

no test coverage detected