@@ -58,6 +58,8 @@ export default class ScrollBar extends React.Component<ScrollBarProps, ScrollBar
58
58
59
59
componentWillUnmount ( ) {
60
60
this . removeEvents ( ) ;
61
+ this . scrollbarRef . current ?. removeEventListener ( 'touchstart' , this . onScrollbarTouchStart ) ;
62
+ this . thumbRef . current ?. removeEventListener ( 'touchstart' , this . onMouseDown ) ;
61
63
clearTimeout ( this . visibleTimeout ) ;
62
64
}
63
65
@@ -92,10 +94,7 @@ export default class ScrollBar extends React.Component<ScrollBarProps, ScrollBar
92
94
window . removeEventListener ( 'mousemove' , this . onMouseMove ) ;
93
95
window . removeEventListener ( 'mouseup' , this . onMouseUp ) ;
94
96
95
- this . scrollbarRef . current ?. removeEventListener ( 'touchstart' , this . onScrollbarTouchStart ) ;
96
-
97
97
if ( this . thumbRef . current ) {
98
- this . thumbRef . current . removeEventListener ( 'touchstart' , this . onMouseDown ) ;
99
98
this . thumbRef . current . removeEventListener ( 'touchmove' , this . onMouseMove ) ;
100
99
this . thumbRef . current . removeEventListener ( 'touchend' , this . onMouseUp ) ;
101
100
}
@@ -122,7 +121,6 @@ export default class ScrollBar extends React.Component<ScrollBarProps, ScrollBar
122
121
onMouseMove = ( e : MouseEvent | TouchEvent ) => {
123
122
const { dragging, pageY, startTop } = this . state ;
124
123
const { onScroll } = this . props ;
125
-
126
124
raf . cancel ( this . moveRaf ) ;
127
125
128
126
if ( dragging ) {
0 commit comments