reverie
reverie copied to clipboard
Mobile Dropdown menus not animating and sub menu items not clickable (SOLVED)
I came across an issue with a clients site where the dropdown menus would not slide to show the dropdown, on iOS.. after researching it, I found that it was the link structure in the dropdown HTML..
Here is the generated menu HTML (from nav.php) before the fix (notice the lack of href):
<li id="menu-item-138" class="menu-item menu-item-main-menu menu-item-products has-dropdown"><a href="#">Products</a>
After - notice the href is now applied to the link
<li id="menu-item-138" class="menu-item menu-item-main-menu menu-item-products has-dropdown"><a >Products</a>
To resolve this.. I adjusted the $attributes var buildout on line 102 from this:
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
To this:
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : ' href="#"';
Just simply made sure that there was an HREF applied, even if it contains '#' as some browsers were failing on this...
No pull request, but this might be a great update! Thanks for all the hard work!!
Pull Request created