@@ -21,7 +21,7 @@ export const RIPPLE_FADE_OUT_DURATION = 400;
21
21
* Timeout for ignoring mouse events. Mouse events will be temporary ignored after touch
22
22
* events to avoid synthetic mouse events.
23
23
*/
24
- const ignoreMouseEventsTimeout = 800 ;
24
+ const IGNORE_MOUSE_EVENTS_TIMEOUT = 800 ;
25
25
26
26
export type RippleConfig = {
27
27
color ?: string ;
@@ -190,7 +190,7 @@ export class RippleRenderer {
190
190
/** Function being called whenever the trigger is being pressed using mouse. */
191
191
private onMousedown ( event : MouseEvent ) {
192
192
const isSyntheticEvent = this . _lastTouchStartEvent &&
193
- event . timeStamp < this . _lastTouchStartEvent + ignoreMouseEventsTimeout ;
193
+ Date . now ( ) < this . _lastTouchStartEvent + IGNORE_MOUSE_EVENTS_TIMEOUT ;
194
194
195
195
if ( ! this . rippleDisabled && ! isSyntheticEvent ) {
196
196
this . _isPointerDown = true ;
@@ -204,7 +204,7 @@ export class RippleRenderer {
204
204
// Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse
205
205
// events will launch a second ripple if we don't ignore mouse events for a specific
206
206
// time after a touchstart event.
207
- this . _lastTouchStartEvent = event . timeStamp ;
207
+ this . _lastTouchStartEvent = Date . now ( ) ;
208
208
this . _isPointerDown = true ;
209
209
210
210
this . fadeInRipple ( event . touches [ 0 ] . clientX , event . touches [ 0 ] . clientY , this . rippleConfig ) ;
0 commit comments