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.

Incompatible with passive event listeners

See original GitHub issue

When used with recent Chrome builds that support passive event listeners, touch interaction leads to a massive spew of errors:

Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

PhotoSwipe needs to detect passive event listener support and explicitly register its document level touch handlers with a passive: false option.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
capuskicommented, Mar 12, 2017

I’m still having problems with this issue. Because of this, when you use photoswipe on mobile devices, when you swipe to close a image, the page jumps to the top, really bad =/

0reactions
dimsemenovcommented, Apr 29, 2021

fixed by v5.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passive event listeners | Can I use... Support tables for HTML5 ...
Event listeners created with the passive: true option cannot cancel ( preventDefault() ) the events they receive. Primarily intended to be used with...
Read more >
Unable to preventDefault inside passive event listener due to ...
I have taken the code snippet from jquery-3.5.js lib. The snippet in bold causes this issues since the said event(event for which you...
Read more >
Browser Compatibility of Passive event listeners on Opera 81
With passive event listeners, the browser can schedule events in the document queues more efficiently. This is especially useful in touch and ...
Read more >
Use Passive Event Listeners to prevent scroll interruptions
Use Passive Event Listeners to prevent scroll interruptions · Simple usage · Disable scrolling, touch, or wheel events · Gotcha 1 · Gotcha...
Read more >
Promises and Events: Some Pitfalls and Workarounds
addEventListener( event, resolve, { // For simplicity, we will assume passive listeners. // Feel free to expose this as a configuration ...
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