@@ -460,7 +460,10 @@ export class Resizable extends React.PureComponent<ResizableProps, State> {
460
460
this . window . addEventListener ( 'mouseup' , this . onMouseUp ) ;
461
461
this . window . addEventListener ( 'mousemove' , this . onMouseMove ) ;
462
462
this . window . addEventListener ( 'mouseleave' , this . onMouseUp ) ;
463
- this . window . addEventListener ( 'touchmove' , this . onMouseMove ) ;
463
+ this . window . addEventListener ( 'touchmove' , this . onMouseMove , {
464
+ capture : true ,
465
+ passive : false ,
466
+ } ) ;
464
467
this . window . addEventListener ( 'touchend' , this . onMouseUp ) ;
465
468
}
466
469
}
@@ -470,7 +473,7 @@ export class Resizable extends React.PureComponent<ResizableProps, State> {
470
473
this . window . removeEventListener ( 'mouseup' , this . onMouseUp ) ;
471
474
this . window . removeEventListener ( 'mousemove' , this . onMouseMove ) ;
472
475
this . window . removeEventListener ( 'mouseleave' , this . onMouseUp ) ;
473
- this . window . removeEventListener ( 'touchmove' , this . onMouseMove ) ;
476
+ this . window . removeEventListener ( 'touchmove' , this . onMouseMove , true ) ;
474
477
this . window . removeEventListener ( 'touchend' , this . onMouseUp ) ;
475
478
}
476
479
}
@@ -727,6 +730,14 @@ export class Resizable extends React.PureComponent<ResizableProps, State> {
727
730
if ( ! this . state . isResizing || ! this . resizable || ! this . window ) {
728
731
return ;
729
732
}
733
+ if ( event instanceof TouchEvent ) {
734
+ try {
735
+ event . preventDefault ( ) ;
736
+ event . stopPropagation ( ) ;
737
+ } catch ( e ) {
738
+ // Ignore on fail
739
+ }
740
+ }
730
741
let { maxWidth, maxHeight, minWidth, minHeight } = this . props ;
731
742
const clientX = event instanceof this . window . MouseEvent ? event . clientX : event . touches [ 0 ] . clientX ;
732
743
const clientY = event instanceof this . window . MouseEvent ? event . clientY : event . touches [ 0 ] . clientY ;
0 commit comments