drift
drift copied to clipboard
Passive event listeners don't allow preventDefault()
It seems that you register the event listeners with the options parameter false
as default.
The browser changes this options to
Happens in this Method (Trigger.js):
_bindEvents() {
this.settings.el.addEventListener("mouseenter", this._handleEntry, false);
this.settings.el.addEventListener("mouseleave", this._hide, false);
this.settings.el.addEventListener("mousemove", this._handleMovement, false);
const isPassive = { passive: this.settings.passive };
if (this.settings.handleTouch) {
this.settings.el.addEventListener("touchstart", this._handleEntry, isPassive);
this.settings.el.addEventListener("touchend", this._hide, false);
this.settings.el.addEventListener("touchmove", this._handleMovement, isPassive);
} else {
this.settings.el.addEventListener("touchstart", this._preventDefault, isPassive);
this.settings.el.addEventListener("touchend", this._preventDefault, false);
this.settings.el.addEventListener("touchmove", this._preventDefault, isPassive);
}
}
Guess when you define the options instead of just using "false" as an option parameter will fix this issue.
Screenshots
Information:
- drift version: v1.5.0
- browser version: https://www.whatsmybrowser.org/b/AVRWC
Hey @claudio147 thanks for opening this issue. I'll look into this over the next day or so and get back to you with any updates.
@sherwinski
if(e.cancelable)
e.preventDefault();
@sherwinski Any updates on this?
Hey @claudio147, I'm sorry it's been a while. We had some high priorities issues that took our eye off the ball here.
We're still planning on getting to this. I can't give you an exact time estimate, but we'll update you as soon as we get a chance to tackle this.
Thanks again for reporting this issue.
@claudio147 , could you kindly test the given PR #672 and see if the issue persists? Thank you!