passive eventlisteners

This commit is contained in:
Felix Schulze 2019-11-12 18:02:52 +01:00
parent 4fbc2a6c39
commit 2cf7294ce0

View File

@ -3120,7 +3120,7 @@ MaterialTooltip.prototype.init = function () {
this.forElement_.addEventListener('touchend', this.boundMouseEnterHandler, false); this.forElement_.addEventListener('touchend', this.boundMouseEnterHandler, false);
this.forElement_.addEventListener('mouseleave', this.boundMouseLeaveAndScrollHandler, false); this.forElement_.addEventListener('mouseleave', this.boundMouseLeaveAndScrollHandler, false);
window.addEventListener('scroll', this.boundMouseLeaveAndScrollHandler, true); 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.ignoringMouseDown_ = false;
this.boundDownHandler = this.downHandler_.bind(this); this.boundDownHandler = this.downHandler_.bind(this);
this.element_.addEventListener('mousedown', this.boundDownHandler); 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.boundUpHandler = this.upHandler_.bind(this);
this.element_.addEventListener('mouseup', this.boundUpHandler); this.element_.addEventListener('mouseup', this.boundUpHandler);
this.element_.addEventListener('mouseleave', this.boundUpHandler); this.element_.addEventListener('mouseleave', this.boundUpHandler);