-
AuthorPosts
-
June 18, 2021 at 12:12 am #1306245
I have a fullwidth submenu control on a page, the menu has a structure like:
Animals > Dogs > LabThe menu is set to “Display a button to open menu” and if the “Hide Mobile Menu Submenu Items” option is enabled then only the leaf nodes (Lab) are clickable on mobile; the other nodes (Animals, Dog) are not clickable. If that option is disabled and the full menu is shown, then all nodes in the menu are clickable.
Example:
https://learn.gototags.com/nfc/hardware/phonesWhy is this? Is this expected behavior? How can I make it so all nodes are clickable?
- This topic was modified 3 years, 5 months ago by ctadlock.
June 19, 2021 at 6:49 pm #1306523Hey ctadlock,
Thank you for your patience, and the link to your site but I’m having trouble understanding your issue, so far I understand that it is that some sub-items in the sub-menu on mobile are not clickable. When I check the Tag items in the sub-menu all seem to be clickable, so on desktop it is like this on hover:
On mobile after opening the menu and clicking Tag all of the sub-items are clickable:
I do note that your sub-items have arrows making them look like there are further sub-items, but there are not. Perhaps this is what you ment?Best regards,
MikeJune 22, 2021 at 10:23 pm #1307035The only reason those links in your screenshot work is that they are leaf nodes. There is no way to navigate to any page that is not a leaf node in the menu. Clicking on the menu item will only open/close the menu, it wont navigate to the page.
REPRO
1. On an iPhone navigate to https://learn.gototags.com/nfc/hardware/phones
2. Click the secondary menu “Menu” burger; this will expand the menu
3.Try to navigate to the “/nfc/chip” page by clicking the “Chip” menu item; the menu item will be expanded to show the children of ChipThe core issue here is that a mouse click on a menu item needs to either be “open/close” menu OR navigate to page for that menu item. I have seen this solved elsewhere by differentiating between clicking on the text of the menu item and the greater area surrounding the menu item text.
As for the arrows on the menu items; I have not customized that all all so it must be a part of the the theme.
June 23, 2021 at 11:44 am #1307118June 23, 2021 at 11:17 pm #1307212That only works for the main menu. I have several additional menus for each section of my website that I want that same behavior applied to. That is why I am using the “fullwidth submenu” control.
- This reply was modified 3 years, 4 months ago by ctadlock.
June 26, 2021 at 7:09 pm #1307528Hi,
Thank you for your patience, I investigated this further as it pertains to the Fullwidth Submenu element, and currently if a top-level item has a sub-menu then in mobile the first click opens the sub-menu and the second click goes to that items link, but items in the top-level sub-menu don’t behave this way. I reviewed the script for this and was able to extend it for the second level sub-menus, Try adding this code to the end of your functions.php file in Appearance > Editor:function fullwidth_submenu_mobile_script() { ?> <script> (function($){ $('.avia_mobile').on('click', '.av-menu-mobile-disabled li ul.av-visible-mobile-sublist li a', function() { var current = $(this); var list_item = current.siblings('ul'); if(list_item.length) { if(list_item.hasClass('av-visible-mobile-sublist')) { } else { $('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist'); list_item.addClass('av-visible-mobile-sublist'); return false; } } }); }(jQuery)); </script> <?php } add_action('wp_footer', 'fullwidth_submenu_mobile_script');
I tested this on your /nfc/ page by injecting the script via the browser dev tools mobile simulation, and what I noticed is the second level sub-menus items were off the screen at 425px because the menu items are 200px wide, but your text length will fit in a 100px menu so I would also recommend this css:
@media only screen and (max-width: 767px) { #top .av-subnav-menu > li ul { width: 100px !important; } #top .av-subnav-menu > li ul ul { left: 98px !important; } }
Best regards,
MikeJuly 1, 2021 at 2:14 am #1308213I deployed both of these changes; the code in functions.php does not work as expected and the CSS change yields a strange result. I dont see that the code change is working at all. I have to back out the changes.
Given that this issue is not specific to my site and applies to all uses of the theme, how about you just add this functionality to the theme?
July 1, 2021 at 12:48 pm #1308312Hi,
Sorry to hear this didn’t work for you, it seemed to work for me when I injected it, are you forcing jQuery to load in your footer? Did you try it with WP Rocket disabled?
Anyways I have submitted this to the dev team to review, I will reply when I hear back from them, thank you for your patience.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.