Last modified: 2014-10-02 06:05:51 UTC
Created attachment 16627 [details] Top Dropdown menu On my touch screen laptop, when i try to click on top dropdown menu, Instead of menu expansion, it is redirecting me user page. I can't hover using touch screen, So i suggest you to remove hover property and replace it with click.
Thank for bringing this up, touch screen desktops are certainly an edge case for this ( the number of users accessing the desktop site from touch devices is extremely low) One of our planned updates, is to change the behavior of the compact personal bar on touch devices, as a fallback.
Most of these desktop touchscreens still have/support mice in addition, right? I think this makes sense. The only risk is if people perceive it as inconsistent, but as long as it only fires for an actual touch (not a click on a device that happens to support touch), this is not an issue in my opinion. I think it could continue to listen to hover as well, though. That means if you're using a touch-screen device with a mouse, hover will still work. Side note, some touch screen devices support hover for your actual finger. E.g. on my Galaxy S4 I can hover my finger over the phone dial pad and see my speed dial contacts before touching. I have no idea if any devices expose this hover event to JavaScript.
Sounds like you want to work in this Matt ;)
(In reply to Jared Zimmerman (WMF) from comment #3) > Sounds like you want to work in this Matt ;) Okay, given that the actual expand/collapse is in CSS (with :hover), my idea is to either: 1. Use :focus as well (doesn't seem to be working, I think because it's focusing on the <a> element, not the <li>, but may be correctable with tabindex). 2. Use a class to mark when it's opened. Then the question is which events to use to either focus it or add that class (and then remove). I'm thinking: On the element: touchend - Open (but maybe also close if they touch again when it's already open) touchleave - Close Outside the element: touchend - Close I haven't done anything with touch events before, so this will take a little iteration.