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

Chrome 74: Unable to preventDefault inside passive event listener due to target being treated as passive. #337

Open
SvetlozarValchev opened this issue May 15, 2019 · 12 comments

Comments

@SvetlozarValchev
Copy link

Bug report

Expected behaviour

No errors in Dev Console

Actual behaviour

When Zooming in/out, the console repeatedly logs the following error: Unable to preventDefault inside passive event listener due to target being treated as passive.

Steps to reproduce the behaviour

  1. Zoom In/Out
  2. Observe Dev Console

Configuration

  • svg-pan-zoom version: 3.6.0
  • Browser(s): Chrome 74
  • Operating system(s): Windows 10 Pro
@Vktun
Copy link

Vktun commented May 22, 2019

I have same problem about this

@TrishE
Copy link

TrishE commented Jun 12, 2019

I have the same problem.

1 similar comment
@azhengyongqin
Copy link

I have the same problem.

@ethubert
Copy link

ethubert commented Oct 10, 2019

You can get rid of the message by commenting line 845 in the the library ( i included the file in a browser app at the moment so I'll just drop the code you need to find.
Probably not the best way but it works and didn't break anything for now.

`
/**
* Handle mouse wheel event
*
* @param {Event} evt
*/

SvgPanZoom.prototype.handleMouseWheel = function(evt) {
  if (!this.options.zoomEnabled || this.state !== "none") {
    return;
  }

  if (this.options.preventMouseEventsDefault) {
    if (evt.preventDefault) {
      // evt.preventDefault(); COMMENT THIS LINE
    } else {
      evt.returnValue = false;
    }
  }

@ariutta
Copy link
Collaborator

ariutta commented Oct 29, 2019

Hi @SvetlozarValchev, could you review this pull request to verify it solves this issue:
#355
Thanks!

@SvetlozarValchev
Copy link
Author

I can confirm I no longer can reproduce the issue.

@gingerr
Copy link

gingerr commented Oct 30, 2019

Doesnt this change zoom the svg and scrools the browser window at the same time then (if the page that hosts the svg is scrollable cause of long content? I think the purpose of this preventDefault() here is to prevent that scrolling.

@ariutta
Copy link
Collaborator

ariutta commented Oct 30, 2019

@SvetlozarValchev thanks for checking. Just to clarify, which code did you test for reproducing the issue: current master or pull request #355?

@ariutta
Copy link
Collaborator

ariutta commented Oct 30, 2019

@gingerr you're talking about pull request #355, right?

@BodoMinea
Copy link

For now people who encounter this issue may try cloning and building from https://github.com/Bigfellahull/svg-pan-zoom, the repo from where the PR came. That´s what I did and it worked.

@wassfila
Copy link

wassfila commented Jan 16, 2021

@BodoMinea you did a great job, but I assume that you intentionally did not want to push the built dist result ?

I created a fork including the file ready to be used, I have to admit that this great library is unusable without this fix.

https://github.com/WebSVG/svg-pan-zoom/tree/master/dist

@connerkennedy32
Copy link

connerkennedy32 commented Nov 30, 2023

Still experiencing this issue with version 3.12.1. Any file I can change now that will fix this with the newest chrome version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants