Skip to content

Commit f96472c

Browse files
authored
fix: remove native title from TableToolbarMenu (#22013)
1 parent 19e73c0 commit f96472c

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

packages/react/src/components/DataTable/TableToolbarMenu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const TableToolbarMenu = ({
3737
<OverflowMenu
3838
renderIcon={renderIcon}
3939
className={toolbarActionClasses}
40-
title={iconDescription}
4140
iconDescription={iconDescription}
4241
menuOptionsClass={menuOptionsClasses}
4342
flipped

packages/react/src/components/DataTable/__tests__/TableToolbarMenu-test.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,21 @@ describe('TableToolbarMenu', () => {
4141
</TableToolbarMenu>
4242
);
4343

44-
expect(screen.getByText('Icon description')).toBeInTheDocument();
44+
expect(
45+
screen.getByRole('button', { name: 'Icon description' })
46+
).not.toHaveAttribute('title');
47+
});
48+
49+
it('should not render a native title attribute', () => {
50+
render(
51+
<TableToolbarMenu>
52+
<span>test</span>
53+
</TableToolbarMenu>
54+
);
55+
56+
expect(
57+
screen.getByRole('button', { name: 'Settings' })
58+
).not.toHaveAttribute('title');
4559
});
4660

4761
it('should respect renderIcon prop', () => {

packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@ exports[`DataTable behaves as expected selection should render and match snapsho
585585
aria-haspopup="true"
586586
aria-labelledby="tooltip-_r_2t_"
587587
class="cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md cds--btn cds--btn--md cds--layout--size-md cds--btn--ghost cds--btn--icon-only"
588-
title="Settings"
589588
type="button"
590589
>
591590
<svg
@@ -1022,7 +1021,6 @@ exports[`DataTable renders as expected - Component API should render and match s
10221021
aria-haspopup="true"
10231022
aria-labelledby="tooltip-_r_m_"
10241023
class="cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md cds--btn cds--btn--md cds--layout--size-md cds--btn--ghost cds--btn--icon-only"
1025-
title="Settings"
10261024
type="button"
10271025
>
10281026
<svg

packages/react/src/components/DataTable/__tests__/__snapshots__/TableToolbarMenu-test.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ exports[`TableToolbarMenu renders as expected - Component API should render 1`]
1616
aria-haspopup="true"
1717
aria-labelledby="tooltip-_r_1_"
1818
class="custom-class cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md cds--btn cds--btn--md cds--layout--size-md cds--btn--ghost cds--btn--icon-only"
19-
title="Add"
2019
type="button"
2120
>
2221
<svg

0 commit comments

Comments
 (0)