From 2cf7294ce0c793395361f31835dbaa79d19fe973 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Tue, 12 Nov 2019 18:02:52 +0100 Subject: [PATCH] passive eventlisteners --- src/js/material.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/material.js b/src/js/material.js index 994825a..92f5a70 100644 --- a/src/js/material.js +++ b/src/js/material.js @@ -3120,7 +3120,7 @@ MaterialTooltip.prototype.init = function () { this.forElement_.addEventListener('touchend', this.boundMouseEnterHandler, false); this.forElement_.addEventListener('mouseleave', this.boundMouseLeaveAndScrollHandler, false); window.addEventListener('scroll', this.boundMouseLeaveAndScrollHandler, true); - window.addEventListener('touchstart', this.boundMouseLeaveAndScrollHandler); + window.addEventListener('touchstart', this.boundMouseLeaveAndScrollHandler, {passive: true}); } } }; @@ -3905,7 +3905,7 @@ MaterialRipple.prototype.init = function () { this.ignoringMouseDown_ = false; this.boundDownHandler = this.downHandler_.bind(this); this.element_.addEventListener('mousedown', this.boundDownHandler); - this.element_.addEventListener('touchstart', this.boundDownHandler); + this.element_.addEventListener('touchstart', this.boundDownHandler, {passive: true}); this.boundUpHandler = this.upHandler_.bind(this); this.element_.addEventListener('mouseup', this.boundUpHandler); this.element_.addEventListener('mouseleave', this.boundUpHandler);