asvd/dragscroll

Dynamically re-activate the dragscroll

FireGreeks opened this issue · 4 comments

Searching for an answer I read this issue : #4
So what I am trying to do is reactivate the dragscoll after using reset()

I tried to rename the className, but it didn't work - after resetting it I can't find a way to put it back up. Maybe I am missing something....

if (isDragged) {
     document.body.className = "";
     dragscroll.reset()
} else {
      document.body.className = "dragscroll";
}`

Great library btw ;)

dragscroll.reset() does not only remove the existing listener, it also adds new ones (at least from my experience)

if (isDragged) {
     document.body.className = "";
} else {
      document.body.className = "dragscroll";
}
dragscroll.reset()

should do the trick

Any ideas on how I'll be able to call this in React?

Found the solution for resetting on react if anyone needs to know.
dragscroll.reset() should be called inside componentDidMount()

how enable it on angular? it works only once after page reload