I have written a peace of code to get the event based on touch and non-touch. Its working all other browsers and devices, but Firefox. Default FF return the true
.
var thumbsEvent, isTouch = Modernizr.touch; // detect the touch
if(isTouch){
thumbsEvent = 'click';//on touch surface, click
}
else {
thumbsEvent = 'mouseover';//on non touch surface, mouseover
}
Is there a way to manage this issue.
Example fiddle
Modernizr is a JavaScript library that detects the features available in a user's browser. This lets web pages avoid unsupported features by informing the user their browser isn't supported or loading a polyfill.
On behalf of Modernizr - We're really sorry about this.
Modernizr.touch
has been renamed Modernizr.touchevents
in the yet-to-be-released version 3.0, as it is a far more accurate description of the detect. Basically, all this detect is doing is checking for the existence of touch events, and returning true if they are found. Desktop chrome does the same thing if you enable developer tools. It just means that your version of firefox on your laptop is reporting support of touch events, for several possible reasons.
i had the same issue, this fixed it for me: in firefox go to "about:config", then search for the setting "dom.w3c_touch_events.enabled" and reset that one. i then had to restart firefox and afterwards "Modernizr.touch" correctly returned "false" for me.
source: https://github.com/Modernizr/Modernizr/issues/1225
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With