Problem

The title of the main menu is always displayed for assistive technology, even when we want it to not be displayed.

In the file named "block--system-menu-block--main.html", the comment says: If not displayed, we still provide it for screen readers.

But this is counterproductive behaviour because there is already a menu title in the nav element. Assistive technologies already indicate the presence of a menu as well as the menu title in the aria-label attribute, so there is no need to explicitly define an additional title.

Moreover, the presence of the <h2> heading distorts the document layout and hinders navigation by title.

Steps to reproduce

  1. Configuring the main menu, uncheck the option "Display the title" and save
  2. Inspect the rendered menu markup
  3. Observe the presence of a visually-hidden menu title

Proposed resolution

Remove the forced menu title display.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

spryah created an issue. See original summary.

spryah’s picture

Issue summary: View changes

Fixed missing words in summary...

spryah’s picture

Status: Active » Needs review
spryah’s picture

Issue summary: View changes

Added a clarification concerning the layout of the document

pdureau made their first commit to this issue’s fork.

  • pdureau committed 3f347688 on 1.0.x authored by spryah
    Issue #3382890 by spryah: remove force title display on main-menu
    
pdureau’s picture

Title: Remove the forced menu title display when "display title" is set to false » [beta4] Remove the forced menu title display when "display title" is set to false
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.