Skip to content

Commit 638b2d9

Browse files
committed
Only include aria range values once per utilization bar chart
We used to set aria range attributes for both the "used" and the "remaining" parts. While we need both to nicely show a 100% bar chart, it makes no semantic sense to present both to accessibility tools. This patch drops the aria attributes on the remaining "progress-bar".
1 parent 82be64f commit 638b2d9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/charts/utilization-bar/utilization-bar-chart.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<span ng-if="!chartFooter && (!footerLabelFormat || footerLabelFormat === 'actual')"><strong>{{chartData.used}} of {{chartData.total}} {{units}}</strong> Used</span>
1010
<span ng-if="!chartFooter && footerLabelFormat === 'percent'"><strong>{{chartData.percentageUsed}}%</strong> Used</span>
1111
</div>
12-
<div class="progress-bar progress-bar-remaining" aria-valuenow="{{100 - chartData.percentageUsed}}" aria-valuemin="0" aria-valuemax="100"
12+
<div class="progress-bar progress-bar-remaining"
1313
ng-style="{width:(100 - chartData.percentageUsed) + '%'}" tooltip="{{100 - chartData.percentageUsed}}% Available">
1414
</div>
1515
</div>
@@ -26,7 +26,7 @@
2626
<span ng-if="(!chartFooter) && (!footerLabelFormat || footerLabelFormat === 'actual')" ng-style="{'max-width':layout.footerLabelWidth}"><strong>{{chartData.used}} {{units}}</strong> Used</span>
2727
<span ng-if="(!chartFooter) && footerLabelFormat === 'percent'" ng-style="{'max-width':layout.footerLabelWidth}"><strong>{{chartData.percentageUsed}}%</strong> Used</span>
2828
</div>
29-
<div class="progress-bar progress-bar-remaining" aria-valuenow="{{100 - chartData.percentageUsed}}" aria-valuemin="0" aria-valuemax="100"
29+
<div class="progress-bar progress-bar-remaining"
3030
ng-style="{width:(100 - chartData.percentageUsed) + '%'}" tooltip="{{100 - chartData.percentageUsed}}% Available">
3131
</div>
3232
</div>

test/charts/utilization-bar/utilization-bar.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ describe('Directive: pfUtilizationBarChart', function() {
3939
});
4040

4141
it("should set aria-valuenow values", function() {
42-
remaining = angular.element(element).find('.progress-bar-remaining');
4342
used = angular.element(element).find('.progress-bar').not('.progress-bar-remaining');
44-
expect(remaining.attr('aria-valuenow')).toBe("20");
4543
expect(used.attr('aria-valuenow')).toBe("80");
4644
});
4745

0 commit comments

Comments
 (0)