Buttons for submenus do not work on Android

Created on 23 February 2024, 4 months ago
Updated 27 February 2024, 4 months ago

Problem/Motivation

The button to trigger navigation to submenus does not work on Android, and I cannot use the menu to navigate to sub-menu pages.

Steps to reproduce

I have the module installed on https://safesupportivelearning.ed.gov and the sub-menu buttons do not work and a click on the right-facing chevron takes the user to the top-level page for the menu

I checked the demonstration site listed on the module page on drupal.org: https://www.balliol.ox.ac.uk
And the sub-menu buttons do not work on that site either. When i click the sub-navigation menu, the right-facing chevron disappears and a highlighting of the div appears to go under the narrow view of the website to the right of the navigation menu.

For testing, I used the https://lambdatest.com browser emulator. I originally was informed the mobile menu did not work by a person using an actual Android device.

Proposed resolution

Adjust the code to make the submenu buttons work on Android devices.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.4

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @austin_brian
  • 🇮🇹Italy tanc Italy

    I was able to replicate the issue with Chrome on Android on your site. But I can't replicate the issue with the same browser on the menu.js site which makes me think it's something with the Drupal markup that the browser doesn't like.

    It'll need some investigation but I rarely have time I'm afraid. If you want to investigate the markup and try to get it as close to the menu.js recommended markup that would be good.

  • 🇺🇸United States drakythe

    I can confirm this is an issue, and that it can actually be replicated using Chrome browser (at least on MacOS) by using the viewport emulation feature of the developer tools. As long as you select a device that makes it emulate touch it will error in the same way.

    We examined the mmenujs.com version of the menu and discovered that it has no instances where the parent level menu item is also a link. It is possible this is a problem with the mmenujs library itself, though I didn't dig deep enough into their repo to see for myself if that was the case.

    It appears to be 2 anchor tags inside of a single li element that causes the problem. The problem seems to be that the maximum width of the first anchor tag goes super wide and pushes the second anchor tag wrapping the ">" graphic off the visible canvas. Occasionally this even results in all of the ">" graphics vanishing from the menu on affected devices, though we can't seem to consistently make that part happen. We have applied a temporary fix by manually assigning a maximum width using media queries. Our next step is to add our own supplementary JS to properly calculate the maximum width and set it in circumstances where that is necessary.

  • Thank you @drakythe

    I added a css rule
    .mm-listitem a {
    max-width: 285px;
    }

    Which made the child links clickable for my client on an Android phone.

Production build 0.69.0 2024