Skip to content

Commit

Permalink
Merge pull request #5738 from matuzalemsteles/fix-table-a11y-error
Browse files Browse the repository at this point in the history
fix(@clayui/core): fix accessibility error for `aria-colindex` value
  • Loading branch information
matuzalemsteles authored Dec 12, 2023
2 parents 5266f5e + 221ea27 commit 457faa6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/clay-core/src/table/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const Cell = React.forwardRef<HTMLTableCellElement, Props>(
<As
{...otherProps}
{...focusWithinProps}
aria-colindex={isHead && !sortable ? undefined : index}
aria-colindex={isHead && !sortable ? undefined : index! + 1}
aria-describedby={
isHead && sortable ? sortDescriptionId : undefined
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ exports[`Table basic rendering render dynamic content 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,name"
tabindex="-1"
>
Foo
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,type"
tabindex="-1"
Expand All @@ -55,15 +55,15 @@ exports[`Table basic rendering render dynamic content 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,name"
tabindex="-1"
>
Bar
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,type"
tabindex="-1"
Expand All @@ -77,15 +77,15 @@ exports[`Table basic rendering render dynamic content 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,name"
tabindex="-1"
>
Baz
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,type"
tabindex="-1"
Expand Down Expand Up @@ -132,15 +132,15 @@ exports[`Table basic rendering render static content 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,$.0"
tabindex="-1"
>
Foo
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,$.1"
tabindex="-1"
Expand All @@ -154,15 +154,15 @@ exports[`Table basic rendering render static content 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,$.0"
tabindex="-1"
>
Bar
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,$.1"
tabindex="-1"
Expand All @@ -176,15 +176,15 @@ exports[`Table basic rendering render static content 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,$.0"
tabindex="-1"
>
Baz
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,$.1"
tabindex="-1"
Expand All @@ -209,7 +209,7 @@ exports[`Table basic rendering render with sort column 1`] = `
<thead>
<tr>
<th
aria-colindex="0"
aria-colindex="1"
aria-describedby="clay-id-13"
aria-sort="none"
class="table-head-title"
Expand All @@ -229,7 +229,7 @@ exports[`Table basic rendering render with sort column 1`] = `
</a>
</th>
<th
aria-colindex="1"
aria-colindex="2"
aria-describedby="clay-id-13"
aria-sort="none"
class="table-head-title"
Expand Down Expand Up @@ -257,15 +257,15 @@ exports[`Table basic rendering render with sort column 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,$.0"
tabindex="-1"
>
Foo
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,$.1"
tabindex="-1"
Expand All @@ -279,15 +279,15 @@ exports[`Table basic rendering render with sort column 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,$.0"
tabindex="-1"
>
Bar
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,$.1"
tabindex="-1"
Expand All @@ -301,15 +301,15 @@ exports[`Table basic rendering render with sort column 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,$.0"
tabindex="-1"
>
Baz
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,$.1"
tabindex="-1"
Expand Down Expand Up @@ -364,7 +364,7 @@ exports[`Table basic rendering render with treegrid 1`] = `
tabindex="0"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,1:name"
role="gridcell"
Expand All @@ -382,7 +382,7 @@ exports[`Table basic rendering render with treegrid 1`] = `
</div>
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,1:type"
role="gridcell"
Expand All @@ -402,7 +402,7 @@ exports[`Table basic rendering render with treegrid 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,2:name"
role="gridcell"
Expand Down Expand Up @@ -439,7 +439,7 @@ exports[`Table basic rendering render with treegrid 1`] = `
</div>
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,2:type"
role="gridcell"
Expand All @@ -458,7 +458,7 @@ exports[`Table basic rendering render with treegrid 1`] = `
tabindex="-1"
>
<td
aria-colindex="0"
aria-colindex="1"
class=""
data-id="string,10:name"
role="gridcell"
Expand All @@ -476,7 +476,7 @@ exports[`Table basic rendering render with treegrid 1`] = `
</div>
</td>
<td
aria-colindex="1"
aria-colindex="2"
class=""
data-id="string,10:type"
role="gridcell"
Expand Down

0 comments on commit 457faa6

Please sign in to comment.