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

Audit and fix usages of pix_icons inside interactive elements


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

      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

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


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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.