Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passive event listeners don't allow preventDefault() #647

Closed
claudio147 opened this issue Oct 18, 2021 · 5 comments · Fixed by #672
Closed

Passive event listeners don't allow preventDefault() #647

claudio147 opened this issue Oct 18, 2021 · 5 comments · Fixed by #672
Labels
hacktoberfest Good first issue for hacktober contributors

Comments

@claudio147
Copy link

It seems that you register the event listeners with the options parameter false as default.
The browser changes this options to
image

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
image

Information:

@sherwinski
Copy link
Contributor

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.

@makethemesgreatagain
Copy link

@sherwinski

if(e.cancelable)
    e.preventDefault();

@claudio147
Copy link
Author

@sherwinski Any updates on this?

@luqven
Copy link
Contributor

luqven commented Sep 27, 2022

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.

@luqven luqven added the hacktoberfest Good first issue for hacktober contributors label Sep 28, 2022
sisco0 added a commit to sisco0/drift that referenced this issue Oct 5, 2022
@sisco0
Copy link
Contributor

sisco0 commented Oct 5, 2022

@claudio147 , could you kindly test the given PR #672 and see if the issue persists?
Thank you!

@luqven luqven linked a pull request Oct 5, 2022 that will close this issue
9 tasks
sisco0 added a commit to sisco0/drift that referenced this issue Oct 6, 2022
luqven pushed a commit that referenced this issue Oct 10, 2022
luqven pushed a commit that referenced this issue Oct 10, 2022
imgix-git-robot pushed a commit that referenced this issue Oct 10, 2022
## [1.5.1](v1.5.0...v1.5.1) (2022-10-10)

### Bug Fixes

* add required test for eventlistener ([c43f12e](c43f12e)), closes [#647](#647)
* remove optional eventlistener parameters ([d546ce1](d546ce1)), closes [#647](#647)

 [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Good first issue for hacktober contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants