This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ const numbers = {
40
40
INITIAL_ORIGIN_SCALE : 0.6 ,
41
41
DEACTIVATION_TIMEOUT_MS : 225 , // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
42
42
FG_DEACTIVATION_MS : 150 , // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)
43
+ TAP_DELAY_MS : 300 , // Delay between touch and simulated mouse events on touch devices
43
44
} ;
44
45
45
46
export { cssClasses , strings , numbers } ;
Original file line number Diff line number Diff line change @@ -295,8 +295,7 @@ class MDCRippleFoundation extends MDCFoundation {
295
295
296
296
// Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
297
297
const previousActivationEvent = this . previousActivationEvent_ ;
298
- const isSameInteraction = previousActivationEvent && e && previousActivationEvent . type !== e . type &&
299
- previousActivationEvent . clientX === e . clientX && previousActivationEvent . clientY === e . clientY ;
298
+ const isSameInteraction = previousActivationEvent && e && previousActivationEvent . type !== e . type ;
300
299
if ( isSameInteraction ) {
301
300
return ;
302
301
}
@@ -428,7 +427,7 @@ class MDCRippleFoundation extends MDCFoundation {
428
427
this . activationState_ = this . defaultActivationState_ ( ) ;
429
428
// Touch devices may fire additional events for the same interaction within a short time.
430
429
// Store the previous event until it's safe to assume that subsequent events are for new interactions.
431
- setTimeout ( ( ) => this . previousActivationEvent_ = null , 100 ) ;
430
+ setTimeout ( ( ) => this . previousActivationEvent_ = null , MDCRippleFoundation . numbers . TAP_DELAY_MS ) ;
432
431
}
433
432
434
433
/**
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ testFoundation('only re-activates when there are no additional pointer events to
333
333
334
334
documentHandlers . mouseup ( ) ;
335
335
mockRaf . flush ( ) ;
336
- clock . tick ( DEACTIVATION_TIMEOUT_MS ) ;
336
+ clock . tick ( numbers . TAP_DELAY_MS ) ;
337
337
338
338
// Finally, verify that since mouseup happened, we can re-activate the ripple.
339
339
handlers . mousedown ( { pageX : 0 , pageY : 0 } ) ;
You can’t perform that action at this time.
0 commit comments