question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PS bug in mobile ([Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.)

See original GitHub issue

Hello,

I am having this issue with perfect scrollbar only on mobile. I guess the bug appears only on touch event. When scrolling the bar I get this error in console:

perfect-scrollbar.esm.js?b7f5:562
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

And this is the line where it cannot prevent default:

function mouseMoveHandler(e) {
    if (e.touches && e.touches[0]) {
      e[pageY] = e.touches[0].pageY;
    }
    element[scrollTop] =
      startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
    addScrollingClass(i, y);
    updateGeometry(i);

    e.stopPropagation();
    e.preventDefault(); // Here
  }

Steps to reproduce:

  1. Check my fiddle: https://jsfiddle.net/671duorb/1/
  2. Open Console (F12)
  3. Toggle device toolbar
  4. Select one of the mobile screens
  5. Try to drag the scrollbar (not screen, the bar itself)

In jsfiddle console nothing will appear, but in your browsers console you will get the above mentioned error. After that the scrollbar gets stuck in focused state until refresh.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

1reaction
amiranagramcommented, Jul 16, 2022

I changed 3 jobs and 4 frameworks, I don’t care anymore.

1reaction
thiagotebergacommented, Jul 15, 2022

Has the problem been solved? I have the same problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Easy fix for: Unable to preventDefault inside passive event ...
1. Remove the need for preventDefault() in the event listener · 2. Mark the event listener not the be passive (not recommended).
Read more >
Unable to preventDefault inside passive event listener (...)
Getting the following error in chrome dev. tools while scrolling: ... inside passive event listener due to target being treated as passive.
Read more >
Unable to preventDefault inside passive event listener
This is a helpful article to understand the problem: developer.chrome.com/blog/scrolling-intervention Quoting: "impacted pages are fixed relatively easily by ...
Read more >
Unable to preventDefault inside passive event listener due to ...
Hello, We were getting in chrome an error when scrolling the dxLists saying "Unable to preventDefault inside passive event listener due to ...
Read more >
Upfront mobile burger menu problem - WPMU Dev
And a warning appears: " jquery.js?ver=1.12.4:3 Unable to preventDefault inside passive event listener due to the target being treated as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found