inuyaksa / jquery.nicescroll

nicescroll plugin for jquery - scrollbars like iphone/ipad
https://nicescroll.areaaperta.com/
3.6k stars 1.67k forks source link

delegated events are not cleaned up propperly #762

Closed volkerrichert closed 2 years ago

volkerrichert commented 6 years ago

If you have multiple nicescroll on a page and "remove()" one of them the delegated events are not clean up an will result in a a lot of

jquery.nicescroll.js:1259 Uncaught TypeError: Cannot read property 'rail' of null at HTMLHtmlElement.self.ontouchmove (jquery.nicescroll.js:1259) at HTMLDocument.f (jquery.nicescroll.js:2492)

when you move your mouse (touch emulation enabled).

I try to find out what happend:

davidsturgeon commented 5 years ago

I fixed this by changing the .delegate to a .bind I'm not sure what delegate is even doing.

sKopheK commented 5 years ago

Hi, @davidsturgeon have you merged your changes anywhere? We are facing the same issue and @inuyaksa does not seem to be following issues in this repository.