@@ -78,6 +78,9 @@ export default function(ctx) {
78
78
} ;
79
79
80
80
events . touchstart = function ( event ) {
81
+ // Prevent emulated mouse events because we will fully handle the touch here.
82
+ // This does not stop the touch events from propogating to mapbox though.
83
+ event . originalEvent . preventDefault ( ) ;
81
84
if ( ! ctx . options . touchEnabled ) {
82
85
return ;
83
86
}
@@ -92,6 +95,7 @@ export default function(ctx) {
92
95
} ;
93
96
94
97
events . touchmove = function ( event ) {
98
+ event . originalEvent . preventDefault ( ) ;
95
99
if ( ! ctx . options . touchEnabled ) {
96
100
return ;
97
101
}
@@ -101,6 +105,7 @@ export default function(ctx) {
101
105
} ;
102
106
103
107
events . touchend = function ( event ) {
108
+ event . originalEvent . preventDefault ( ) ;
104
109
if ( ! ctx . options . touchEnabled ) {
105
110
return ;
106
111
}
@@ -219,9 +224,9 @@ export default function(ctx) {
219
224
ctx . map . on ( 'mouseup' , events . mouseup ) ;
220
225
ctx . map . on ( 'data' , events . data ) ;
221
226
222
- ctx . map . on ( 'touchmove' , events . touchmove , { passive : true } ) ;
223
- ctx . map . on ( 'touchstart' , events . touchstart , { passive : true } ) ;
224
- ctx . map . on ( 'touchend' , events . touchend , { passive : true } ) ;
227
+ ctx . map . on ( 'touchmove' , events . touchmove ) ;
228
+ ctx . map . on ( 'touchstart' , events . touchstart ) ;
229
+ ctx . map . on ( 'touchend' , events . touchend ) ;
225
230
226
231
ctx . container . addEventListener ( 'mouseout' , events . mouseout ) ;
227
232
0 commit comments