Skip to content

Commit

Permalink
feat(@clayui/core): Adds attribute sortAriaLabel on Cell for custom a…
Browse files Browse the repository at this point in the history
…ria-label on sort button
  • Loading branch information
pat270 committed Jan 8, 2024
1 parent 4c606b4 commit 686d943
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/clay-core/src/table/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ type Props = {
*/
sortable?: boolean;

/**
* Sets the `aria-label` on the sort button. The default is "Sort Column".
*/
sortAriaLabel?: string;

/**
* Aligns horizontally contents inside the Cell.
*/
Expand Down Expand Up @@ -93,6 +98,7 @@ export const Cell = React.forwardRef<HTMLTableCellElement, Props>(
index,
keyValue,
sortable,
sortAriaLabel = 'Sort Column',

Check failure on line 101 in packages/clay-core/src/table/Cell.tsx

View workflow job for this annotation

GitHub Actions / test

Expected object keys to be in sorted order. Expected sortAriaLabel to be before sortable
textAlign,
textValue,
truncate,
Expand Down Expand Up @@ -245,7 +251,7 @@ export const Cell = React.forwardRef<HTMLTableCellElement, Props>(
</Layout.ContentCol>
<Layout.ContentCol>
<button
aria-label="Sort Column"
aria-label={sortAriaLabel}
className="component-action"
type="button"
>
Expand Down

0 comments on commit 686d943

Please sign in to comment.