hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
24.09k stars 2.63k forks source link

After PAN stopped once its reached the boundary, Position Resets #1251

Open msmani9891 opened 4 years ago

msmani9891 commented 4 years ago

Am working on a feature, which has draggable element used with pan option. And it is hides beyond the viewport/body.

So that checked a condition on when the position goes to < 0, stopped the drag with stop().

Its working fine, as it wont allow the div not to go beyond the viewport. But, there is a problem while again pan the div. The position resets to inital position. I just want the pan from the pervious position not from the reset location.

I have recreated this problem with this example: https://codepen.io/msmani9891/pen/ZEboGwV