-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top level menu item links do not work with touch-only device #32
Comments
Did you ever resolve this @Padawan83 ? |
@blake7 : I would be very glad to see and test these 15 lines, could you please share your solution here ? |
Certainly. Let me add some comments in the code.. and i'll attach here momentarily :-) |
Hi @Padawan83.
|
Hello Thank you for your help. I tried your patch but encountered the same behaviour as with my trials: when touched, top level menu item opens its panel but the link is also followed. So the panel opens briefly, and the new page is loaded However I did not try with the same device as you, I used an android tablet and phone. It could be the issue... I was trying to get the mega menu to open on touch, and if clicked again to follow the link. |
I am having the same issue with top level (parent) links being dead on iPad running iOS 9.3.1. I can either have the Accessible MegaMenu things work for keyboard nav on desktop or have the top level links work for mobile, not both. This is a major issue and does not seem to affect all sites implementing this, so I am at a loss. For instance http://www.washington.edu works fine and with expected behavior, but http://www.vt.edu does not work and I am at a loss to determine why. I am still trying to figure out what is going wrong, but this problem persists. UPDATE: I still need to do some more QA on this, but I think I found what was blocking the click action on a touch device. I commented out lines 306 and 307 under the _clickHandler function. These lines were: event.preventDefault(); These were blocking the parent link. I am still able to pop the dropdown open with the first tap, and collapse it by tapping anywhere off the parent link. Again, I am going to do some more QA on this over the next day or so and will stop back to comment when complete. Right now it looks like lines 306 and 307 could be removed. UPDATE 2: Ok, so everything checks out across desktop (Win and OS X) and iOS. The Android (v4.4 and up) behavior doesn't change whether those lines are commented or not. On Android the parent links are followed and there is no click event capture to leave the dropdown open, so there is a flash of a dropdown as it goes to the parent link location. Some more work needs to be done on the _clickHandler, but I've made this hack work for iOS devices for now. |
I was having the same issues on Android Chrome browser I would have to double click to open the menu, on iOS devices clicking on the top level would open them menu but would go to the url in the top level link. I fixed it by using an older version on the script, specifically reverted to the commit 201f1cc and now behaviour is expected. I did notice another issue on the samsung device internet browser where it works improperly still probably likely due to the fact that a link has a click and a hover event on touch devices for samsung. |
+1 It doesn't work on iPad or any of the tablet devices. This needed to be resolved as soon as possible. This is a great plugin, btw, but needed to be fixed :) |
+1 Surfaces and touch-enabled Ultrabooks are becoming more popular, and thus this is becoming an even bigger obstacle for our userbase. |
Fix top-level link touch handling - Issue adobe-accessibility#32
This is going to be a long post, so please bear with me... :) I have started using this jquery-based keyboard accessible mega-menu plugin recently, and found it interesting. While testing it out on different platforms (Desktop, iOS and Android) I encountered the same issues that are reported here (Issue #32 and issue #31). I am working on a fix for these touchscreen related issues, but the fix goes counter to some of the design recommendations of this plugin (mainly, removing anchor tag from top-level menu items, and have them to show menus only). Digging deeper into the library's code and its behaviour across various user interface events (click, touch, hover, keyboard) made me analyse the menus on following web-pages:
The documentation of the library indicates that the HTML for this menu needs to have following structure:
With the above HTML, the mega-menu that gets rendered exhibits following behaviour on the demo page on different platforms:
The above behaviour made me read up more about touch events and design principles for handling both touch and mouse events, in a uniform manner. This is where I believe the library's approach of providing a "link (anchor) tag" as well as a menu, for top-level nav items, is erroneous. Reasoning: Now coming to how https://adobe.com works on Desktop and Mobile platforms. It wasn't surprising to see that the mega-menu on adobe.com doesn't show the menu on "hover" action. Instead, a click is needed to show the menu. How about navigating to top-level links? Well, all the top level links have anchor tags with href="#". Which in essence means, there's no top-level navigation links. And thats the reason why https://adobe.com works uniformly across desktop and mobile browsers. In nutshell: I'll send PRs for any bugs around the touch-based issues that I can fix, but would be happy to hear what others in the community think about the above observations. @majornista @Padawan83 @multimediavt @azinck @peterc (tagging folks from issues #31 and #32) |
When touched for the first time, top level items display their respective panel, but when touched for the second time (while panel is open) nothing happens.
The demo page does not work either for top level items links with tablets and smartphones.
I have tried numerous solutions messing up with _clickHandler function, but to no avail so far. Has anybody managed to make it work with tablets ans smartphones?
The text was updated successfully, but these errors were encountered: