studiometa / js-toolkit

🔧 A data-attributes driven JavaScript tiny framework
https://js-toolkit.studiometa.dev/
MIT License
31 stars 3 forks source link

[useDrag] Delta is not correctly computed #532

Closed titouanmathis closed 3 hours ago

titouanmathis commented 3 hours ago

When chaining multiple drag actions on an element using the useDrag service or the withDrag decorator, there might be a jump when starting the second or third drag when using the delta props as it is not correctly computed.

See this playground for tests.

titouanmathis commented 2 hours ago

The fix can be tested on this updated playground.