Support for passive event listeners
See original GitHub issueVueJS offers a .passive
to make an event listener passive to improve performance https://vuejs.org/v2/guide/events.html#main , is there a way to achieve the same with this library?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top 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 >Use passive listeners to improve scrolling performance
Touch and wheel event listeners are useful for tracking user interactions and creating custom scrolling experiences, but they can also delay ...
Read more >What are passive event listeners? - javascript - Stack Overflow
Passive event listeners are an emerging web standard, new feature shipped in Chrome 51 that provide a major potential boost to scroll performance....
Read more >Passive Event Listeners: Solution to ''Does not use ... - Screpy
What Passive Event Listeners basically does is try to eliminate the need for waiting for the work of touch and wheel event listeners...
Read more >Cross Browser Compatibility Score of Passive event listeners
Browser Support for Passive event listeners · Chrome · Safari · Firefox · IE Internet Explorer · Opera · Edge ...
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 FreeTop 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
Top GitHub Comments
To answer the OP, if you look at the code you will see that there is a check if the browser does support passive
var isPassiveSupported = (function() { var supportsPassive = false; try { var opts = Object.defineProperty({}, 'passive', { get: function() { supportsPassive = true; } }); window.addEventListener('test', null, opts); } catch (e) {} return supportsPassive; })();
the boolean returned from this is used to set if the event listener is passive: true or false
@oldbootz I have simplified your code (merge two
case
branch into one). And release a new versionv2.3.0
. Thanks a lot