Surface Pro 3 with Firefox - with touchscreen touchscreen display or mouse events instead of events on wheels

On Surface Pro 3 only with Firefox:

When you perform one-finger gestures on an element, the browser touchmove wheel events instead of touchmove or mousemove . How do you stop wheel behavior and allow one finger to always be considered a touch / mouse movement?

So, I want to consider one finger as a series of mousemove or touchmove instead of wheel events. I don’t want to swipe one finger to scroll the page if you scroll this element. This is easy to do in Chrome and IE11. This seems impossible right now in Firefox. The current one I think is a mistake, but maybe something is missing me.

Here is a simplified example:

http://codepen.io/simonsarris/pen/PwbdRZ

 var can = document.getElementById('can'); can.addEventListener('mousemove', function(e) { // Will never happen on the Surface Pro 3 in Firefox // Will happen in IE11 though console.log('mouseMove') }); can.addEventListener('touchmove', function(e) { // Will never happen on the Surface Pro 3 in Firefox // Will happen in Chrome though console.log('touchMove') }); // Stops the window from scrolling in firefox when you swipe on the element // But stopping this does not allow the single touch gesture to register as mousemove or touchmove events can.addEventListener('wheel', function(e) { console.log('wheel') e.preventDefault(); }); // consider also the 'DOMMouseScroll' event, though preventing this event will not stop firefox from panning the page. 

Since I prevent the default value from wheel , page scrolling stops when one finger scrolls up or down

Window scrolling stops in firefox if you slide your finger over the red box, but no mousemove or touchmove events will fire. (but mousemove will fire if you swipe horizontally, not vertically)

+6
source share
1 answer

In the desktop version of Firefox (36.0.4), touch events are disabled, although they will work when Firefox starts in Metro mode or by explicitly enabling them through the dom.w3c_touch_events.enabled parameter. For more information, see the MDN article on touch events .

0
source

Source: https://habr.com/ru/post/980543/


All Articles