File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 231231 }
232232 }
233233 // disable synth mouse events, unless this event is itself simulated
234- if ( type === 'touchend' && ! ev . __polymerSimulatedTouch ) {
234+ if ( type === 'touchend' ) {
235235 POINTERSTATE . mouse . target = Polymer . dom ( ev ) . rootTarget ;
236236 // ignore syntethic mouse events after a touch
237- ignoreMouse ( true ) ;
237+ ignoreMouse ( ) ;
238238 }
239239 }
240240 }
404404 if ( recognizer . info ) {
405405 recognizer . info . prevent = true ;
406406 }
407+ } ,
408+ /**
409+ * Reset the 2500ms timeout on processing mouse input after detecting touch input.
410+ *
411+ * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch.
412+ * This method should only be called during testing with simulated touch inputs.
413+ * Calling this method in production may cause duplicate taps or other gestures.
414+ *
415+ * @method resetMouseCanceller
416+ */
417+ resetMouseCanceller : function ( ) {
418+ if ( POINTERSTATE . mouse . mouseIgnoreJob ) {
419+ POINTERSTATE . mouse . mouseIgnoreJob . complete ( ) ;
420+ }
407421 }
408422 } ;
409423
Original file line number Diff line number Diff line change 256256 } ) ;
257257 teardown ( function ( ) {
258258 el . parentNode . removeChild ( el ) ;
259+ Polymer . Gestures . resetMouseCanceller ( ) ;
259260 } ) ;
260261
261262 test ( 'tap' , function ( ) {
313314 ] ;
314315 ev . clientX = clientX ;
315316 ev . clientY = clientY ;
316- ev . __polymerSimulatedTouch = true ;
317317 child . dispatchEvent ( ev ) ;
318318
319319 for ( var i = 0 ; i < 10 ; i ++ ) {
330330 ev . clientX = clientX ;
331331 ev . clientY = clientY ;
332332 // tell gestures to not turn off mouse events
333- ev . __polymerSimulatedTouch = true ;
334333 child . dispatchEvent ( ev ) ;
335334 }
336335
You can’t perform that action at this time.
0 commit comments