Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Enable touch support for nav menu links with subitems as seen in TwentySixteen #957
I'm sorry that I cannot directly contribute to this one as my JS skills are very poor. The problem is that normal menu (didn't test with mobile) cannot handle touch events for menu items that are links themselves.
To reproduce this, create a menu item (link to page, cat, etc.), add subitem, then try to expand the menu on a tablet. After clicking on menu item (link) submenu will be displayed for a very short time, until browser is redirecting to the parent item link.
This problem is solved in Twenty Sixteen and JS code is very similar. I was trying to make some changes to no avail :(
Another possible solution could be this:
There are some more code samples, but of course I would vote for the Twenty Sixteen implementation as we would have similar code among WP themes. Perhaps others already have some good working solutions?