Когда использовать
Implement direct manipulation that preserves position and velocity.
Решения для реализации
- Use pointer capture and handle pointercancel, with a keyboard alternative.
- Use a damped spring for return motion; simple hover belongs in CSS.
- Integrate with elapsed seconds and clamp delta after tab suspension.
- Stop when settled, hidden or reduced motion is active.
Как проверить результат
- Leaving the target does not lose the gesture.
- New drag interrupts at the current position.
- Reduced motion returns instantly.
Работающий пример
Потяни. Отпусти. Ещё раз.k 140 / damping 15