Skip to content

Commit

Permalink
fix: makes aria-label optional (carbon-design-system#17467)
Browse files Browse the repository at this point in the history
  • Loading branch information
2nikhiltom authored Sep 19, 2024
1 parent fab91fa commit 7956f63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/components/DataTable/TableExpandHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type TableExpandHeaderPropsBase = {
* Specify the string read by a voice reader when the expand trigger is
* focused
*/
['aria-label']: string;
['aria-label']?: string;

/**
* @deprecated The enableExpando prop is being replaced by `enableToggle`
Expand Down Expand Up @@ -150,7 +150,7 @@ TableExpandHeader.propTypes = {
className: PropTypes.string,

/**
* The enableExpando prop is being replaced by enableToggle
* The enableExpando prop is being replaced by TableExpandHeader
*/
enableExpando: deprecate(
PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('TableExpandHeader', () => {
<TableHead>
<TableRow>
<TableExpandHeader
ariaLabel="test-label"
aria-label="test-label"
isExpanded={false}
onExpand={jest.fn()}
className="custom-class"
Expand All @@ -43,12 +43,12 @@ describe('TableExpandHeader', () => {
expect(container).toMatchSnapshot();
});

it('should respect ariaLabel prop', () => {
it('should respect aria-label prop', () => {
render(
<Table>
<TableHead>
<TableRow>
<TableExpandHeader isExpanded enableToggle ariaLabel="Expand" />
<TableExpandHeader isExpanded aria-label="Expand" enableToggle />
</TableRow>
</TableHead>
</Table>
Expand Down

0 comments on commit 7956f63

Please sign in to comment.