setPointerCapture()
A method that sends all further events from one pointer to a chosen element, even if the pointer moves outside it or off the page.
In more detail
It needs the pointerId from the pointer event. Call it on pointerdown when a drag starts so the drag keeps tracking smoothly; the capture ends automatically on pointerup.
Related terms
- Pointer Events — A single set of events, such as pointerdown and pointermove, that covers mouse, pen and touch input with one code path.
Taught in
- Pointer Events, Focus Trapping And Keyboard Accessibility — Frontend Architecture & Web Platform