@@ -306,13 +306,17 @@ IonicModule
306
306
} ;
307
307
308
308
function destroy ( ) {
309
- ionic . off ( touchStartEvent , handleTouchstart , scrollChild ) ;
310
- ionic . off ( touchMoveEvent , handleTouchmove , scrollChild ) ;
311
- ionic . off ( touchEndEvent , handleTouchend , scrollChild ) ;
312
- ionic . off ( 'mousedown' , handleMousedown , scrollChild ) ;
313
- ionic . off ( 'mousemove' , handleTouchmove , scrollChild ) ;
314
- ionic . off ( 'mouseup' , handleTouchend , scrollChild ) ;
315
- ionic . off ( 'scroll' , handleScroll , scrollParent ) ;
309
+ if ( scrollChild ) {
310
+ ionic . off ( touchStartEvent , handleTouchstart , scrollChild ) ;
311
+ ionic . off ( touchMoveEvent , handleTouchmove , scrollChild ) ;
312
+ ionic . off ( touchEndEvent , handleTouchend , scrollChild ) ;
313
+ ionic . off ( 'mousedown' , handleMousedown , scrollChild ) ;
314
+ ionic . off ( 'mousemove' , handleTouchmove , scrollChild ) ;
315
+ ionic . off ( 'mouseup' , handleTouchend , scrollChild ) ;
316
+ }
317
+ if ( scrollParent ) {
318
+ ionic . off ( 'scroll' , handleScroll , scrollParent ) ;
319
+ }
316
320
scrollParent = null ;
317
321
scrollChild = null ;
318
322
}
0 commit comments