Opened 6 years ago

Closed 6 years ago

#17931 closed defect (worksforme)

has("touch") returns false on FireFox

Reported by: ManuAir Owned by:
Priority: undecided Milestone: tbd
Component: Core Version: 1.9.3
Keywords: Cc: Sebastien Pereira
Blocked By: Blocking: #17932

Description

Dojo's function, has("touch"), returns false on FireFox? 28.0 in a Laptop that has a touch screen.

Using IE 11 or Chrome 34.0.1847.131 m, has() returns the correct answer.

I found this while reading dojo/touch.js and using the FireFox?'s debugger, but I can reproduce the problem using the example at the end of this page: http://dojotoolkit.org/reference-guide/1.9/dojo/has.html#dojo-has

Change History (4)

comment:1 Changed 6 years ago by bill

Blocking: 17932 added

comment:2 Changed 6 years ago by bill

Cc: Sebastien Pereira added

Duplicate/covered by #17810?

But according to https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events, firefox still supports touchstart/touchmove/touchend, so I'm not sure why has("touch") is returning false. OTOH https://bugzilla.mozilla.org/show_bug.cgi?id=795567 indicates that FF is going to support Pointer Events.

Sebastien also sent mail about this (see http://thread.gmane.org/gmane.comp.web.dojo.devel/19555/focus=19556), repeating what he wrote in that ticket, but no one besides me answered.

comment:3 Changed 6 years ago by Sebastien Pereira

On FF desktop the touch feature is not enabled by default (this is still true on FF 29 by the way). Go to about:config and look for property dom.w3c_touch_events.enabled. There are 3 possible values: disable (0), enable (1), and auto-detect(2). When disabled, a touch on the screen will generate compatible mouse events instead of touch events, and hasTouch will indeed return false.

Ref: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events#Gecko_notes

comment:4 Changed 6 years ago by bill

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.