Unable to preventDefault inside passive event listener invocation.
Great work on this. Hard work much appreciated.
Describe the bug
93 error count in the chrome console, of the message: Unable to preventDefault inside passive event listener invocation.
To Reproduce Steps to reproduce the behavior: Happening every time the slider loads
Expected behavior A clear and concise description of what you expected to happen.
Reproducible example
Additional context Add any other context about the problem here.
Your environment
| Software | Version(s) |
|---|---|
| SimpleBar | "simplebar-react": "^2.1.0", |
| Browser | chrome |
| npm/Yarn | yarn, 1.21.1 |
| Operating System | Windows |
Will you accept a PR for this?
It looks like the reason is because of changes in Google chrome.
It should be a simple one or two line fix.
If you can accept a PR, please let me know.
Thanks!
Hey, There have been various contributors on this project submitting PRs so of course I would accept one.
Thanks!
We've come across this issue too. It sometimes happens with pointer devices (e.g. tablet devices or when using the touch device emulation in Google Chrome).
I think it would be enough to change e.preventDefault() to if (e.cancelable) e.preventDefault() at the 4 locations where preventDefault is called. I might try this out and potentially add a PR when I have time.
- https://github.com/Grsmto/simplebar/blob/master/packages/simplebar/src/simplebar.js#L668
- https://github.com/Grsmto/simplebar/blob/master/packages/simplebar/src/simplebar.js#L739
- https://github.com/Grsmto/simplebar/blob/master/packages/simplebar/src/simplebar.js#L782
- https://github.com/Grsmto/simplebar/blob/master/packages/simplebar/src/simplebar.js#L802