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.
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 withstop()
.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