MDN says:
The setPointerCapture() method of the Element interface is used to designate a specific element as the capture target of future pointer events. Subsequent events for the pointer will be targeted at the capture element until capture is released.
And it works as expected if I call setPointerCapture
in pointerDown
callback: example - here you can drag yellow square as fast as you want and it will follow the cursor until pointerUp
event happens.
But if try to capture target in pointerMove
callback it won't work as I expected: example - yellow square follows the cursor until cursor hovers the square. If you move your mouse too fast square will stopped.
How this behavior can be explained? Did i misunderstand the documentation?