Applies to Joomla 5.x and 6.x (source read on 6.2.0) · Cassiopeia · T4 Framework 2.6.2 · any template with its own menu layout As of November 2026

A Joomla mega menu works on mobile when every panel opens from a real button, never from hover alone, and the phone gets a drawer with accordion sections instead of the desktop columns. We read what Joomla 6.2 core, Cassiopeia and the T4 Framework actually ship, compared it with the disclosure navigation pattern in the WAI-ARIA Authoring Practices Guide (APG), and tested the patterns below in a browser, including on our own site. Our own desktop menu fails some of these checks, so that is in here too.

What core, Cassiopeia and T4 do

MenuOpens a submenuOn a phoneKeyboard
Core mod_menu, layout Collapsible Default MenuNo dropdowns, nested lists onlyBootstrap collapse below 768 pxA button toggles the whole list
Cassiopeia, layout Collapsible DropdownClick on a separate toggle button, no hoverSame menu, collapsed below 992 pxToggle is a <button>; no Esc key
T4 2.6.2 mega menuHover with a mouse; first tap opens on a touch deviceOff-canvas drawer with the menu's normal submenusNo key handling in megamenu.js
APG disclosure navigationClick on a button with aria-expandedNot covered by the exampleTab, Enter/Space, Esc closes and returns focus

Joomla core has no mega menu: Cassiopeia gives you dropdowns, and the column layouts come from template frameworks such as T4 or from your own mod_menu layout override.

Pattern 1: a link and a separate button

A top-level item that is both a page and a panel needs two controls. The link goes to the page, the button opens the panel. APG calls this the disclosure navigation menu with top-level links, and Cassiopeia's metismenu layout does the same: next to each parent link it prints a <button class="mm-toggler"> with aria-expanded (when the module's Show Sub-menu Items is Yes), its script opens the submenu when that button is clicked, and its CSS has no hover rule for submenus.

The markup we tested, as your layout override would print it:

<!-- templates/your_template/html/mod_menu/disclosure.php -->
<nav aria-label="Main">
  <ul class="dnav">
    <li class="dnav-item">
      <a href="/services">Services</a>
      <button type="button" class="dnav-toggle" aria-expanded="false" aria-controls="dnav-245">
        <span class="visually-hidden">Services menu</span>
      </button>
      <div class="dnav-panel" id="dnav-245" hidden>
        <!-- the columns: links, a module, a call to action -->
      </div>
    </li>
  </ul>
</nav>
  • No role="menu", no aria-haspopup. APG's example deliberately avoids the menu role because site navigation does not offer the keyboard behavior screen readers expect from a menu widget. WAI-ARIA 1.2 treats aria-haspopup="true" as "the popup is a menu". Cassiopeia and T4 both print aria-haspopup="true" on their toggles, so a screen reader announces a menu that is not one.
  • The button names the panel. An empty button with a chevron icon has no name. Cassiopeia uses the item title as aria-label; a visually hidden text works the same way.
  • A heading or separator item (no page of its own) gets only the button, with the title as its text.

Pattern 2: hover is an extra, not the trigger

A phone has no hover. T4 2.6.2 handles that in megamenu.js: on a touch device the first tap on a parent link opens the panel and the second tap follows the link. It works, but nobody can tell from the screen that a tap on "Services" will not go to the Services page. A separate button removes that guess. T4 also turns hover off on any browser that reports touch support, so a laptop with a touchscreen gets the tap behavior even when the mouse is used.

Hover still helps mouse users on desktop, so keep it, but only at desktop width and where the main pointer can hover. The Media Queries Level 4 hover feature matches none on touchscreens. This is the script we ran against the markup above:

// media/templates/site/your_template/js/disclosure-nav.js
document.querySelectorAll('.dnav').forEach(nav => {
  const toggles = [...nav.querySelectorAll('.dnav-toggle')];
  const desktop = matchMedia('(min-width: 992px)');
  const canHover = matchMedia('(hover: hover) and (pointer: fine)');
  const panel = btn => document.getElementById(btn.getAttribute('aria-controls'));
  const set = (btn, open, byHover = false) => {
    btn.setAttribute('aria-expanded', String(open));
    btn.dataset.hover = open && byHover ? '1' : '';
    panel(btn).hidden = !open;
  };
  const closeAll = except => toggles.forEach(b => b !== except && set(b, false));

  toggles.forEach(btn => btn.addEventListener('click', () => {
    // opened by hover: the click keeps it open instead of closing it
    if (btn.dataset.hover) return set(btn, true);
    const open = btn.getAttribute('aria-expanded') !== 'true';
    closeAll(btn);
    set(btn, open);
  }));

  // Esc closes the open panel; focus goes back to its button if it was in the menu.
  // Inside a modal drawer (phones), Esc belongs to the drawer.
  document.addEventListener('keydown', e => {
    const btn = toggles.find(b => b.getAttribute('aria-expanded') === 'true');
    if (e.key !== 'Escape' || !btn || e.defaultPrevented || nav.closest('[aria-modal="true"]')) return;
    set(btn, false);
    if (nav.contains(document.activeElement)) btn.focus();
  });

  // focus moving to another item closes the others; tabbing or clicking out closes all
  nav.addEventListener('focusin', e => closeAll(e.target.closest('.dnav-item')?.querySelector('.dnav-toggle')));
  nav.addEventListener('focusout', e => {
    if (e.relatedTarget && !nav.contains(e.relatedTarget)) closeAll();
  });
  document.addEventListener('click', e => {
    if (!nav.contains(e.target)) closeAll();
  });

  // hover is an extra: desktop width and a pointer that can hover (mouse, trackpad)
  toggles.forEach(btn => {
    const item = btn.closest('.dnav-item');
    item.addEventListener('mouseenter', () => {
      if (!desktop.matches || !canHover.matches || btn.getAttribute('aria-expanded') === 'true') return;
      closeAll(btn);
      set(btn, true, true);
    });
    item.addEventListener('mouseleave', () => {
      if (btn.dataset.hover && !item.contains(document.activeElement)) set(btn, false);
    });
  });
});

In Chromium at 1440 px we tabbed from the link to its button, opened the panel with Enter, tabbed into the first link, pressed Esc (panel closed, focus back on the button) and tabbed out past the last link (panel closed). With the mouse: hovering one item opened it and closed the other, a click on the button of a hovered panel kept it open, moving the pointer away with keyboard focus inside the panel left it open until focus moved to another item, and Esc closed a hovered panel without moving focus. At 800 px hover did nothing. The panel sits inside the hovered item, so the pointer can move onto it, and Esc dismisses it from anywhere on the page: the hoverable and dismissible parts of WCAG 2.2 criterion 1.4.13 (Content on Hover or Focus).

Load the script with the Web Asset Manager in your override and keep aria-expanded in sync from this one place. A panel that opens on hover while the button still says aria-expanded="false" tells a screen reader the opposite of what is on screen.

Pattern 3: a drawer with accordion sections on phones

Four columns of links do not fit 390 px. Below your breakpoint, put the menu in an off-canvas drawer and turn each top-level item into one accordion section: the same button, the panel opens under it instead of over the page. With the markup above, the panels only need CSS for that; the script already skips hover below 992 px, and inside a modal drawer it leaves Esc to the drawer:

/* media/templates/site/your_template/css/disclosure-nav.css */
.dnav-toggle { min-width: 44px; min-height: 44px; }

@media (min-width: 992px) {
  .dnav { display: flex; position: relative; }
  .dnav-panel { position: absolute; left: 0; right: 0; top: 100%; }
}

The drawer around them is a dialog, and it needs its own script. Ours, on ThePixel.dev, does these things without a library:

  • The toggle is a <button> with aria-expanded and aria-controls pointing at the drawer; the drawer's sheet has role="dialog" and aria-modal="true".
  • On open, focus moves into the drawer and everything else in <body> gets inert, so Tab cannot wander behind it. Tab and Shift+Tab wrap inside it.
  • Esc closes it and returns focus to the button that opened it. We checked this on the live site at 390 px: drawer open, five sibling elements inert, focus inside; after Esc, focus back on the Menu button and nothing inert.
  • One accordion section open at a time, and the section holding the current page opens by itself.
  • Rotating or resizing up to the desktop breakpoint closes the drawer.

T4's off-canvas drawer opens the menu's normal submenus, not the mega menu's columns and modules, so module content you placed in a mega panel does not appear on phones; our forum answer on T4 mega menu modules covers that case. T4's accordion and drill-down effects add the submenu toggles as <span> elements with click handlers, which a keyboard cannot reach. The drawer library T4 loads gives the panel role="dialog" and closes it on Esc, but T4's default drawer trigger is also a <span>, and its close button carries aria-hidden="true". Check both with a keyboard, and override what fails.

Pattern 4: a second, shorter menu for phones

You can render the same menu twice, or give phones their own. We chose the second. On the ThePixel.dev home page the desktop mega menu panels hold 71 links; the whole phone menu, login and footer buttons included, holds 40. The phone menu is a separate menu type, mostly Alias items that point at the desktop menu items, printed by its own mod_menu layout. That let us drop the descriptions, the latest-posts module and the duplicate links that make sense in a wide panel and are noise in a drawer.

  • Same menu, two layouts: one source of truth, no drift. The phone gets everything the desktop gets, so long menus become long accordions.
  • Two menus: each fits its screen. The cost is upkeep: every new page means an item in both menus, and somebody will forget one.

If you go with two menus, use Alias items rather than URL items where you can. An Alias item points at the desktop menu item, so the layout can tell which entry is the current page and open its section.

Check your own menu in two minutes

Paste this into the browser console on any page of your site. It lists every control in the header and navigation that claims to open something:

// menu-check.js
console.table([...document.querySelectorAll('header [aria-expanded], header [aria-haspopup], nav [aria-expanded], nav [aria-haspopup]')]
  .map(el => {
    const box = el.getBoundingClientRect();
    return {
      text: el.textContent.trim().replace(/\s+/g, ' ').slice(0, 30),
      element: el.tagName.toLowerCase(),
      keyboard: el.matches('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])'),
      expanded: el.getAttribute('aria-expanded'),
      haspopup: el.getAttribute('aria-haspopup'),
      controls: el.getAttribute('aria-controls'),
      size: Math.round(box.width) + ' x ' + Math.round(box.height),
    };
  }));

Read the table like this:

  • keyboard false: a <span> or <div> toggle, or a link without href. Keyboard users cannot open that panel at all.
  • expanded stays false after you hover or click an item open: the attribute is never updated.
  • haspopup true: announced as a menu. Remove it unless the panel really is a role="menu" widget.
  • size below 24 x 24 on the phone layout: under the WCAG 2.2 minimum target size (criterion 2.5.8) unless the spacing exception applies. A size of 0 x 0 just means the control is hidden at this width.

We ran it on our own home page. At 390 px, with the drawer open, the four section buttons are real buttons of 358 x 52 px with aria-controls, and the Menu button is 98 x 44 px and says aria-expanded="true". At 1440 px the desktop mega menu, which is T4's, does not pass: "Products" and "Resources" are <span role="button"> elements that Tab never reaches, "Services" and "Case studies" are links that focus but only open on hover, and all four keep aria-expanded="false" while their panel is open. They also carry aria-haspopup="true". A keyboard user on a desktop reaches the Services and Case studies pages, but none of the 71 links in the panels. Patterns 1 and 2 are the fix, and a template override is the place for it.

Limits of this test

  • Tested in a browser: the markup and script above (Chromium via Playwright, 1440 and 800 px, keyboard and mouse), the console check and the drawer on thepixel.dev (1440 and 390 px), on November 13, 2026.
  • Read from source, not run: core mod_menu and Cassiopeia on Joomla 6.2.0; T4 2.6.2 megamenu.js, offcanvas.js, its drawer layouts and the drawer library. Other T4 versions may differ.
  • Not tested: screen readers, and real touch devices. Playwright on a desktop browser is not a phone; test on one before you ship.

Get your menu fixed

If your Joomla mega menu works with a mouse and nothing else, we can rebuild it as a layout override in your own template: buttons that open the panels and a drawer on phones, both usable with a keyboard and a touchscreen. That is part of our template customization service. For other things you can build without a page builder, see Joomla content blocks without a page builder.