Unit/System Tests a11y NPM Resource Changed PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
24 Oct 2026

Pull Request resolves #48376 .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This is an alternative to #48378

The main differences are the css works (i think - i am not a css-guru)
The html markup is different - I am not convinced that the suggested changes from the report are correct (I can be convinced otherwise perhaps)
There is a cypress test for the shortcut keyboard command JM which toggles the menu

Testing Instructions

This has a css and js change so either use a prebuilt package or use npm i

Actual result BEFORE applying this Pull Request

The toggle menu is a link with no target - if it does something it should be a button - if it goes somewhere then its a link

Expected result AFTER applying this Pull Request

the toggle menu is now a button

There is no visual difference for the toggle menu in open/closed and light/dark

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar brianteeman brianteeman - open - 24 Oct 2026
avatar brianteeman brianteeman - change - 24 Oct 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2026
Category ⇒ Administration Templates (admin) JavaScript NPM Change Unit Tests
avatar brianteeman brianteeman - change - 25 Oct 2026
Labels Added: Unit/System Tests NPM Resource Changed PR-6.2-dev
avatar mbeganyi-a11y
mbeganyi-a11y - comment - 25 Oct 2026

Focus indicator

Just tested this out and the focus indicator renders well in Chrome and Edge but in Firefox all I see if the blue focus indicator and not the white. I notice your outline change of -1 px, which allows us to see all four borders of the indicator (an improvement) but it doesn't get rendered when FF's blue focus indicator competes with it. I, also, am not a CSS guru so I really can't explain the phenomenon better than that, and even that is a (somewhat) educated guess. During my personal attempts to fix this as shown in the other PR, I used an offset of -2 px to account for the rendering in FF.

It's a tricky one, but if you run this script in the JS console it will put the -2px offset and you'll see the rendering in FF is better. Note the !important isn't necessary for final markup and the # subclasses are just temporary names.

(() => {
  const toggle = document.getElementById('menu-collapse');

  if (!toggle) {
    console.error('Toggle Menu button #menu-collapse was not found.');
    return;
  }

  document.getElementById('toggle-focus-test')?.remove();

  const test = document.createElement('style');
  test.id = 'toggle-focus-test';
  test.textContent = `
    .sidebar-wrapper .sidebar-toggle > button#menu-collapse:focus-visible,
    .sidebar-wrapper .sidebar-toggle > button#menu-collapse.focus-visible {
      outline: 2px solid rgb(238, 238, 238) !important;
      outline-offset: -2px !important;
    }
  `;

  document.head.appendChild(test);
})();

Here are two screenshots, the first showing this PR's current focus indicator in Firefox, and the second with the above JS script applied. The rendering difference is clear:

Firefox focus default Firefox focus at -2 pixel offset

aria-expanded versus aria-pressed

I don't disagree that expanded may feel like it makes more logical sense since the control's function looks like a disclosure, but since it's distinctly a toggle I'm still of the belief that pressed is the better choice. A toggle's state is on or off, and the icon beside the text implies this switch-like behaviour. Most critically, the disclosures elsewhere in this interface reveal more controls/options to the user. The Toggle Menu button does not reveal any additional function, so while it's visually expanded, it's functionally toggled.

Separately, I think my biggest gripe with the control is that it isn't really distinctly clear what it does when you first enter the interface. What is a toggle menu, exactly? If there were clearer action words like "Show" or "Hide" I think the function would be a lot clearer for everyone. This is just an opinion.

avatar brianteeman
brianteeman - comment - 25 Oct 2026

Saying it is pressed has zero meaning

avatar mbeganyi-a11y
mbeganyi-a11y - comment - 25 Oct 2026

Saying it is pressed has zero meaning

Which I think ultimately means it's an issue with the default state, because I'd argue the default state has no meaning visually either. Default state: disabled toggle icon, user clicks it, the icon represents the enabled state, the menu collapses. Seems a bit counterintuitive—the icon seems to be sending the wrong message. The menu is already "toggled", why is the icon a disabled switch?

All the more reason to change its text to something practical, or change the icon and have aria-pressed="true" on the default expanded state of the menu. "Toggle Menu, pressed" makes a lot more sense in the default state than "Toggle menu, not pressed".

My main point is that it doesn't function like other disclosure widgets in the menu, as in no new controls are revealed and no new functionality is offered, so it's just a state switch from enabled to disabled—a toggle.

avatar mbeganyi-a11y
mbeganyi-a11y - comment - 25 Oct 2026

Saying it is pressed has zero meaning

Which I think ultimately means it's an issue with the default state, because I'd argue the default state has no meaning visually either. Default state: disabled toggle icon, user clicks it, the icon represents the enabled state, the menu collapses. Seems a bit counterintuitive—the icon seems to be sending the wrong message. The menu is already "toggled", why is the icon a disabled switch?

All the more reason to change its text to something practical, or change the icon and have aria-pressed="true" on the default expanded state of the menu. "Toggle Menu, pressed" makes a lot more sense in the default state than "Toggle menu, not pressed".

My main point is that it doesn't function like other disclosure widgets in the menu, as in no new controls are revealed and no new functionality is offered, so it's just a state switch from enabled to disabled—a toggle. Basically, toggling compact navigation mode on and off.

avatar mbeganyi-a11y
mbeganyi-a11y - comment - 25 Oct 2026

Saying it is pressed has zero meaning

Which I think ultimately means it's an issue with the default state, because I'd argue the default state has no meaning visually either. Default state: disabled toggle icon, user clicks it, the icon represents the enabled state, the menu collapses. Seems a bit counterintuitive—the icon seems to be sending the wrong message. The menu is already "toggled", why is the icon a disabled switch?

All the more reason to change its text to something practical, or change the icon and have aria-pressed="true" on the default expanded state of the menu. "Toggle Menu, pressed" makes a lot more sense in the default state than "Toggle menu, not pressed".

My main point is that it doesn't function like other disclosure widgets in the menu, as in no new controls are revealed and no new functionality is offered, so it's just a state switch from enabled to disabled—a toggle. Basically, toggling compact navigation mode on and off—just changing the presentation.

avatar brianteeman
brianteeman - comment - 25 Oct 2026

Which is exactly what the original report is useless.

Many assistive-technology users will not be able to determine the proper state of the control. As such, they may be blocked from operating the interface or completing the task with confidence.

Other than changing the link to a button and styling it appropriately anything about state is simply wrong. But I am not the expert

avatar brianteeman
brianteeman - comment - 25 Oct 2026

Which is exactly why the original report is useless.

Many assistive-technology users will not be able to determine the proper state of the control. As such, they may be blocked from operating the interface or completing the task with confidence.

Other than changing the link to a button and styling it appropriately anything about state is simply wrong. But I am not the expert

avatar brianteeman
brianteeman - comment - 26 Oct 2026

-2px on my firefox was no better or different than -1px

avatar mbeganyi-a11y
mbeganyi-a11y - comment - 26 Oct 2026

So you got the blue indicator with both values?

avatar brianteeman
brianteeman - comment - 26 Oct 2026

Yes

avatar richard67 richard67 - change - 27 Oct 2026
Title
…
[6.2]Main menu toggle button
[6.2] Main menu toggle button
avatar richard67 richard67 - edited - 27 Oct 2026
avatar brianteeman
brianteeman - comment - 1 Nov 2026

I am keeping the focus css as is in this PR even though it is not perfect as it is better solved with #48742 either before or after this is merged

avatar Nikhil-sinhaa
Nikhil-sinhaa - comment - 3 Nov 2026

@brianteeman Do you want #48742 to cover the button version of the toggle too?

avatar brianteeman
brianteeman - comment - 3 Nov 2026

@Nikhil-sinhaa yes but it cant do that until this is merged OR you can add the focus change for this button to this PR

avatar brianteeman brianteeman - change - 5 Nov 2026
Labels Added: a11y
avatar exlemor exlemor - test_item - 7 Nov 2026 - Tested successfully
avatar exlemor
exlemor - comment - 7 Nov 2026

I have tested this item ✅ successfully on f0e8372

I was able to successfully test this PR fix. Thanks @brianteeman!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48696.
avatar exlemor
exlemor - comment - 7 Nov 2026

I have tested this item ✅ successfully on f0e8372

I was able to successfully test this PR fix. Thanks @brianteeman!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48696.
avatar exlemor
exlemor - comment - 7 Nov 2026

I have tested this item ✅ successfully on f0e8372

I was able to successfully test this PR fix. Thanks @brianteeman!

BEFORE:
PR-48696-BEFORE

AFTER:
PR-48696-AFTER


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48696.

Add a Comment

Login with GitHub to post a comment