If I change the functions as this, it works but sometimes it's slowing
Code:
doPreventPanning: function(e) {
var target = e.target, touch;
// If we have an interaction on a WebComponent we need to check the actual shadow dom element selected
// to determine if it is an input before preventing default behavior
// Side effect to this is if the shadow input does not do anything with 'touchmove' the user could pan
// the screen.
if (this.isInteractiveWebComponentRegEx.test(target.tagName) && e.touches && e.touches.length > 0) {
touch = e.touches[0];
if (touch && touch.target && this.isInputRegex.test(touch.target.tagName)) {
return;
}
}
/* if (target && target.nodeType === 1 && !this.isInputRegex.test(target.tagName)) {
e.preventDefault();
}*/
if (target && target.nodeType === 1 && !this.isInputRegex.test(target.tagName) && e.cancelable) {
e.preventDefault();
}
}
addWindowListener: function(eventName, fn, capturing) {
//window.addEventListener(eventName, fn, Boolean(capturing));
window.addEventListener(eventName, fn, {
capture: Boolean(capturing),
passive: false
});
},
removeWindowListener: function(eventName, fn, capturing) {
// window.removeEventListener(eventName, fn, Boolean(capturing));
window.removeEventListener(eventName, fn, {
capture: Boolean(capturing),
passive: false
});
}