Bug 1603251 - Improve expand/collapse component for screen reader users (#5753)

This commit is contained in:
Mellina Yonashiro 2019-12-18 20:44:21 -03:00 коммит произвёл Cameron Dawson
Родитель e2869e3428
Коммит 49da17f9d3
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -72,7 +72,9 @@ class ClassificationGroup extends React.PureComponent {
currentRepo,
} = this.props;
const expandIcon = detailsShowing ? faMinusSquare : faPlusSquare;
const expandTitle = detailsShowing ? 'Minus sign' : 'Plus sign';
const expandTitle = detailsShowing
? 'Click to collapse'
: 'Click to expand';
return (
<Row className={`justify-content-between ${className}`}>
@ -89,6 +91,7 @@ class ClassificationGroup extends React.PureComponent {
icon={expandIcon}
className="ml-1"
title={expandTitle}
aria-label={expandTitle}
/>
</Badge>
</h4>

Просмотреть файл

@ -29,7 +29,9 @@ export default class Metric extends React.PureComponent {
const { result, name, children } = this.props;
const resultColor = resultColorMap[result];
const expandIcon = detailsShowing ? faMinusSquare : faPlusSquare;
const expandTitle = detailsShowing ? 'Minus sign' : 'Plus sign';
const expandTitle = detailsShowing
? 'Click to collapse'
: 'Click to expand';
return (
<td>
@ -47,7 +49,11 @@ export default class Metric extends React.PureComponent {
{name}
</span>
<span className="btn">
<FontAwesomeIcon icon={expandIcon} title={expandTitle} />
<FontAwesomeIcon
icon={expandIcon}
title={expandTitle}
aria-label={expandTitle}
/>
</span>
</Button>
<span>