[wp-trac] [WordPress Trac] #29906: Submenus can't be dismissed on mobile.

WordPress Trac noreply at wordpress.org
Tue Jun 16 14:53:09 UTC 2015


#29906: Submenus can't be dismissed on mobile.
-------------------------------------------------+-------------------------
 Reporter:  obenland                             |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  high                                 |   Milestone:  4.3
Component:  Toolbar                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  make-flow has-patch needs-testing    |     Focuses:
  needs-refresh desktop-bias                     |
-------------------------------------------------+-------------------------

Comment (by stephdau):

 So, I've been looking into detecting device capabilities in regards to
 touch, and after an easy path (touch events) last week, I basically spent
 yesterday screaming at the web and my laptop (touch screens)...

 At the core of the issue is: browser APIs will let us detect *touch
 events*, but not the presence of a touch screen in and of itself.

 Detecting touch events is all well and fine in the mobile context, but
 we're at a loss to detect a device that runs a standard desktop OS in
 combination with touch capabilities (think MS Surface, for example). This
 is okay in most contexts, but such a device with no other input device
 device will basically be out of luck... And there's nothing we can seem to
 do about it via capability detection.

 Modernizr, for example, used to document their touch detection as
 detecting touch (screens),but they have since moved to clarifying that
 they also only detect touch events (countless discussions online
 documenting the same reason as us as to why): see comments at
 https://github.com/Modernizr/Modernizr/blob/master/feature-
 detects/touchevents.js#L19

 For the record, we also can't complement touch events detection with other
 parameters when the former fails, since we can't even deduct the presence
 of a touch screen through the user-agent string, or the like...

 So, in conclusion, we can most definitely do touch event detection (where
 I'd even go as far as making it globally accessible to all WP JS, and base
 our menu behavior based on that, and be mostly successful at it. But some
 devices will be left out.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29906#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list