-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Dropdown] Submenus not working on mobile [with possible solution] #3183
Comments
I am also seeing this issue. |
Commenting out that line seems to work perfectly. I've not seen any other issues as a result. |
I have this issue as well. |
Thanks everyone for your patience here. I apologize for the delays on a fix. Mobile was triggering |
don't mention it 👍 good work takes time |
Hi,
Dropdown submenus don't work on mobile devices. They open, but you can't click on the items.
Having spent a couple of hours trying to track this down, I've finally figured out what's happening:
In dropdown.js, when touch events are available they are bound to the mouse enter event:
Now, whenever there's a touch event, the handler is called. Note that this doesn't happen on a standard browser. Here's the handler:
When the users taps on an item in the submenu two things now happen:
mouseenter
is called for the.item
. The code checks for another submenu and exits if there isn't one. So far so good...mouseenter
is then called again, this time for the parent menu item (presumably the event is bubbling up the chain). This time the handler finds a submenu, calls the show submenu code (pointlessly, since it's already open), and then callsevent.preventDefault()
.Since
event.preventDefault()
is called, no further events are generated and the click event is hander is never called.Commenting out the
event.preventDefault()
appears to solve the issue, but I don't know if there are other repercussion that need to be taken into account.The text was updated successfully, but these errors were encountered: