MDL-62680 output: Only hide icons with no label
For accessibility we don't want to read an icon with a label immediately next to the label, but in this case it's clearer for the icon to have no alt text / title for both screen readers and non-screen readers. Worse is not reading important information just because it's displayed as an icon.
This commit is contained in:
@@ -694,6 +694,11 @@ class pix_icon implements renderable, templatable {
|
||||
// and some browsers might overwrite it with an empty title.
|
||||
unset($this->attributes['title']);
|
||||
}
|
||||
|
||||
// Hide icons from screen readers that have no alt.
|
||||
if (empty($this->attributes['alt'])) {
|
||||
$this->attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user