I have been trying to stop scrolling in touch devices and I used the touchmove
event for that as:
$('body').on('touchmove.sidebar', function(e){
e.preventDefault();
});
In Chrome console I see the warning:
Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
On github it has been suggested to use touch-action: none
instead of preventDefault()
. So my question is:
Should I use both preventDefault()
and touch-action: none
or only the later? Would the later work for firefox and other touch browsers?