Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66849

Custom menu tooltip title tag added even when not specified

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE

      Description

      Custom menu items, that don't have an optional tooltip title (3rd parameter) specified, end up with duplicated menu item text in the HTML title attribute. This is an accessibility issue because screen readers will read both the link text and the title attribute resulting in every menu item being repeated twice.

      What I expected

      If no tooltip title parameter is specified, there should be no title attribute included in the link.

      How to reproduce this issue

      1. Log in as a Moodle Administrator
      2. Navigate to Site Administration > Appearance > Themes > Theme settings
      3. Add the following line to the Custom Menu Items field and save:

      Moodle community|https://moodle.org

      What actually happens

      Now view the HTML code for the custom menu item called Moodle Community. The HTML code will look like this:

      <a class="nav-item nav-link" href="https://moodle.org" title="Moodle community">Moodle community</a>

      Notice there is a TITLE attribute even though none was specified.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              michael-milette Michael Milette
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Jake Dallimore, Jun Pataleta
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: