scrollmonitor-parallax
scrollmonitor-parallax copied to clipboard
Test for passive support
trafficstars
Shouldn't passive support be added to the scroll addEventListener?
var browserSupportsPassive = false;
if (isInBrowser) {
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
browserSupportsPassive = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {}
}
const useCapture = browserSupportsPassive ? {capture: false, passive: true} : false;
Yes, a PR adding it would be accepted.
I'm pretty sure the scroll event is passive by default