Skip to content

Commit

Permalink
fix(ui5-table): improve accessibility (#2534)
Browse files Browse the repository at this point in the history
  • Loading branch information
MapTo0 authored Dec 2, 2020
1 parent 5f8e0e2 commit e06d6f3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/main/src/Table.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<table border="0" cellspacing="0" cellpadding="0" @keydown="{{_onkeydown}}">
<table border="0" cellspacing="0" cellpadding="0" @keydown="{{_onkeydown}}" role="table">

<thead>
<tr id="{{_id}}-columnHeader" class="ui5-table-header-row" tabindex="0" style="height: 48px" @click="{{_onColumnHeaderClick}}">
<tr id="{{_id}}-columnHeader" role="row" class="ui5-table-header-row" tabindex="0" style="height: 48px" @click="{{_onColumnHeaderClick}}">
{{#each visibleColumns}}
<slot name="{{this._individualSlot}}"></slot>
{{/each}}
Expand All @@ -15,8 +15,8 @@

{{#unless rows.length}}
{{#if showNoData}}
<tr class="ui5-table-no-data-row-root">
<td colspan="{{visibleColumnsCount}}">
<tr class="ui5-table-no-data-row-root" role="row">
<td colspan="{{visibleColumnsCount}}" role="cell">

<div class="ui5-table-no-data-row">
<span>{{noDataText}}</span>
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/TableCell.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<td
tabindex="-1"
part="cell"
role="cell"
>
<slot></slot>
</td>
1 change: 1 addition & 0 deletions packages/main/src/TableColumn.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<th
scope="col"
part="column"
role="columnheader"
>
<slot></slot>
</th>
5 changes: 3 additions & 2 deletions packages/main/src/TableRow.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
aria-label="{{ariaLabelText}}"
data-sap-focus-ref
part="row"
role="row"
>
{{#if shouldPopin}}
{{#each visibleCells}}
Expand All @@ -20,8 +21,8 @@

{{#if shouldPopin}}
{{#each popinCells}}
<tr part="popin-row" class="{{this.classes}}" @click="{{../_onrowclick}}">
<td colspan="{{../visibleCellsCount}}">
<tr part="popin-row" role="row" class="{{this.classes}}" @click="{{../_onrowclick}}">
<td colspan="{{../visibleCellsCount}}" role="cell">
{{#if this.popinText}}
<span class="ui5-table-row-popin-title">{{this.popinText}}:</span>
{{/if}}
Expand Down

0 comments on commit e06d6f3

Please sign in to comment.