PS bug in mobile ([Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.)
See original GitHub issueHello,
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:
- Check my fiddle: https://jsfiddle.net/671duorb/1/
- Open Console (F12)
- Toggle device toolbar
- Select one of the mobile screens
- 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:
- Created 3 years ago
- Reactions:1
- Comments:12
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I changed 3 jobs and 4 frameworks, I don’t care anymore.
Has the problem been solved? I have the same problem.