[6.0] Refactor default frontend menu to fix submenu support and improve accessiblity#45922
Conversation
- improve accessibility with aria attributes for submenus - add keyboard navigation support for enhanced usability and accessibility
…ation (cassiopeia)
…the menu on 'End' key press
Co-authored-by: Viviana Menzel <vivianamenzel@dr-menzel-it.de>
|
I have tested this item ✅ successfully on d09b8b4 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45922. |
|
I have tested this item ✅ successfully on d09b8b4 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45922. |
|
the keyboard navigation part seems to work correctly from an a11y perspective |
|
About the layout shift. Ultimately, it was more a question of whether this should really be done via the module's default layout. I think it depends very much on the template, and the layout in terms of CSS should not come directly from the module. Here you see something I removed again, as I think it is hardly possible to do the right without knowing the template style. If something like this is put into the works in the header for example and you would not have a layout shift. But as the default layout can used in sidebar and/or footer. We can't do this globally I think.
|
|
Thank you @LadySolveig and all the testers, this is an improvement on what was there and a good exploration of what could be done to improve |
Either I'm misunderstanding it or I can't reproduce it. menu3.mp4If there is anything I can fix here, please try rephrasing it again. Thank you. |
|
Hello, This happens for my menus with more levels of (sub)menu-items embedded in the menu-structure: Do you recognise this? Friendly regards, See: [In J6.0.0: The Default appearance of Menus has changed to Collapsible Default Menu!] : |













Pull Request for Issue # .
Summary of Changes
At the moment, the default frontend layout in the menu module is broken an does not show submenu entries at all.
This PR removes opening on hover completely (broken at all) and adds keyboard support as a accessiblity improvement.
Submenu-Items should again be reachable in frontend with the default menu module layout again.
In order to be as accessible as possible, buttons for opening the submenus have been added, and CSS is now included here to minimise the impact on existing pages.
The CSS has been set to specificity 0 with :where(), making it very easy for the user to overwrite.
Keyboard Support
The source as a reference to the keyboard functionality that was implemented here:
https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation-hybrid/#kbd_label
Example Main Navbar
menu.mp4
Example Menu in sidebar
menu2.mp4
Testing Instructions
Main Menu BlogModuleAdvancedchange the settings to---From Module----> `DefaultOnly testable with patched version - should respekt the
End Level setting 4. Change the End Level Setting fromAllto25. Change the End Level Setting to1`6. Test the keyboard support like described above (image, video, link) for the main menu and a sidebar or footer menu.
Icos and images can be set in the tab `Link Type for the menu item

Actual result BEFORE applying this Pull Request
The submenu items are not reachable and the js for expanding on hover is broken.
Expected result AFTER applying this Pull Request
Submenus can be expanded and operated with keyboard support.
Result for step 4

Result for step 5

Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed