Support passive event listeners
Hi,
Can you add passive event listeneres as mentioned this SO post? I'm getting browser warnings in Chrome right now due to this problem.
Greetings, Thomas
var supportsPassiveOption = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassiveOption = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {}
Edited: see comment below.
I started by hard coding the passive: true into place, and now I've paired it to use of preventDefault. You can see the 2 commits I've made already here: https://github.com/markadrake/zingtouch/tree/passive-event-listeners.
I think there's just one more thing which is using the right value for State.js where there is another addEventListener but no reference to whether preventDefault will be called.
Hi,
Thanks for your answer! Unfortunately my team switched to HammerJS for the moment because it might work better for Edge/Explorer.
@Chaoste How did you find it? On my initial research I found this library to be superior.