Review 13.4 Merged

87866[BUGFIX] Improve accessibility of module-menu

Benjamin Kott CR +2 V +2 Normal +60 −23 updated 01/23/25, 12:24

Commit message

This improves the accessibility of the module-menu:

* Activate menuitem on ENTER (like before) and SPACE (new)
* Always focus first menuitem of sub-menu on ENTER/SPACE - even if
  sub-menu is already open.
* Scroll sub-menu into view after opening it.
* Announce name of sub-menu via `aria-label`.
* Relate sub-menu and sub-menu-button via `aria-controls`
* Mark non-menu html-tags as `role=presentation`.

Before this change pressing ENTER/SPACE on an already opened sub-menu
did close the sub-menu instead of focusing the first menuitem.

To close a sub-menu press ESC either from inside sub-menu (like before)
or press ESC/LEFT ARROW when trigger-button is focused (new).

This also fixes unnecessary scrolling on sub-menu closing/opening
triggered by the ARROW UP/ARROW DOWN keypress itself.

This introduces an option to provide an intended state for the
menu-toggle mechanism. Thereby the result can be set instead of just
toggling the current state.

This fixes a minor bug caused by 'TWBS Collapse' defaults that
automatically triggers a toggle on init.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
  • Verified V +2 Done
    • Benjamin Kott +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 34

  1. Benjamin Kott commented on patch set 1 01/23/25, 12:16

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 01/23/25, 12:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72925

  3. Benjamin Kott voted on patch set 1 CR +2 V +2 01/23/25, 12:24

  4. Benjamin Kott merged patch set 2 01/23/25, 12:24