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

Audit and fix usages of pix_icons inside interactive elements

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.10.6, 3.11.2
    • Accessibility
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • 0
    • HQ Team International Sprint 8, HQ Team International Sprint 9

    Description

      When rendering icons within interactive elements (e.g. in button elements) through pix_icon or the mustache pix helper, we should be passing an empty value (empty string or null?) for the alt text parameter to the pix_icon. We should instead be labelling the interactive element itself.

      E.g. for the case of icon buttons, it's more appropriate to set the title and aria-label inside the button itself. Having the title attribute on the button element itself provides a bigger target size for displaying the tooltip on hover.

      Another scenario that would need to be fixed is pix_icon usages inside interactive elements that already have text labels. Having an alt text for the pix_icon that's the same as the element's text label itself will be redundant. pix_icons used in this way should be rendered for presentation only, so the alt text parameter is also not needed.

      For this issue, we need to audit the usages of $OUTPUT->pix_icon() and the #pix mustache helper inside these interactive elements and fix the labels accordingly.

      It would also be good to update the code documentation of pix_icon on how developers should use it properly and when to supply it with the alt text parameter.

      Updating the dev docs about the proper usage of pix_icon would also be good:

      1. For $OUTPUT->pix_icon - documentation about the pix_icon output component seems non-existent yet.
      2. For the #pix mustache helper

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpataleta Jun Pataleta
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 30 minutes
                  1h 30m