-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.10.6, 3.11.2
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
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:
- For $OUTPUT->pix_icon - documentation about the pix_icon output component seems non-existent yet.
- For the #pix mustache helper