@@ -123,7 +123,7 @@ function startUpdate(event: TouchEvent | MouseEvent) {
123
123
const direction = target . getAttribute ( 'data-direction' ) || ''
124
124
// Change crop area
125
125
el . addEventListener ( 'mousemove' , updateCropArea )
126
- el . addEventListener ( 'touchmove' , updateCropArea )
126
+ el . addEventListener ( 'touchmove' , updateCropArea , { passive : true } )
127
127
if ( [ 'nw' , 'se' ] . indexOf ( direction ) >= 0 ) el . classList . add ( 'nwse' )
128
128
if ( [ 'ne' , 'sw' ] . indexOf ( direction ) >= 0 ) el . classList . add ( 'nesw' )
129
129
startPositions . set ( el , {
@@ -134,7 +134,7 @@ function startUpdate(event: TouchEvent | MouseEvent) {
134
134
} else {
135
135
// Move crop area
136
136
el . addEventListener ( 'mousemove' , moveCropArea )
137
- el . addEventListener ( 'touchmove' , moveCropArea )
137
+ el . addEventListener ( 'touchmove' , moveCropArea , { passive : true } )
138
138
}
139
139
}
140
140
@@ -233,7 +233,7 @@ class ImageCropElement extends HTMLElement {
233
233
this . addEventListener ( 'touchend' , stopUpdate )
234
234
this . addEventListener ( 'mouseup' , stopUpdate )
235
235
box . addEventListener ( 'mousedown' , startUpdate )
236
- box . addEventListener ( 'touchstart' , startUpdate )
236
+ box . addEventListener ( 'touchstart' , startUpdate , { passive : true } )
237
237
this . addEventListener ( 'keydown' , moveCropArea )
238
238
this . addEventListener ( 'keydown' , updateCropArea )
239
239
0 commit comments