Skip to content

Commit 0ff1779

Browse files
authored
Merge pull request #361 from cal-smith/table
fix(table): allow screenreaders to read column sorts correctly
2 parents 081e687 + dcec1c5 commit 0ff1779

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/table/table.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ import { I18n } from "./../i18n/i18n.module";
199199
<button
200200
class="bx--table-sort-v2"
201201
*ngIf="this.sort.observers.length > 0 && column.sortable"
202+
[attr.aria-label]="(column.sorted && column.ascending ? sortDescendingLabel : sortAscendingLabel)"
202203
[ngClass]="{
203204
'bx--table-sort-v2--active': column.sorted,
204205
'bx--table-sort-v2--ascending': column.ascending
@@ -210,10 +211,7 @@ import { I18n } from "./../i18n/i18n.module";
210211
</ng-template>
211212
<svg
212213
class="bx--table-sort-v2__icon"
213-
width="10" height="5" viewBox="0 0 10 5"
214-
[attr.aria-label]="(column.sorted && column.ascending ? sortDescendingLabel : sortAscendingLabel)"
215-
[attr.alt]="(column.sorted && column.ascending ? sortDescendingLabel : sortAscendingLabel)">
216-
<title>{{(column.sorted && column.ascending ? sortDescendingLabel : sortAscendingLabel)}}</title>
214+
width="10" height="5" viewBox="0 0 10 5">
217215
<path d="M0 0l5 4.998L10 0z" fill-rule="evenodd" />
218216
</svg>
219217
</button>

0 commit comments

Comments
 (0)