Skip to content

Commit 48d8140

Browse files
fix(Table): updated a11y for empty/nontext Th components (#10152)
* fix(Table): updated a11y for empty/nontext Th components * Updated additional examples and demos * Added initial Th test file * Updated deprecated snapshots, removed outdated integration test
1 parent 5b33290 commit 48d8140

File tree

27 files changed

+93
-37
lines changed

27 files changed

+93
-37
lines changed

packages/react-core/src/demos/Filters/examples/FilterAttributeSearch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ export const FilterAttributeSearch: React.FunctionComponent = () => {
651651
<Table aria-label="Selectable table">
652652
<Thead>
653653
<Tr>
654-
<Th />
654+
<Th screenReaderText="Row select" />
655655
<Th width={20}>{columnNames.name}</Th>
656656
<Th width={10}>{columnNames.threads}</Th>
657657
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/Filters/examples/FilterCheckboxSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ export const FilterCheckboxSelect: React.FunctionComponent = () => {
377377
<Table aria-label="Selectable table">
378378
<Thead>
379379
<Tr>
380-
<Th />
380+
<Th screenReaderText="Row select" />
381381
<Th width={20}>{columnNames.name}</Th>
382382
<Th width={10}>{columnNames.threads}</Th>
383383
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/Filters/examples/FilterFaceted.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ export const FilterFaceted: React.FunctionComponent = () => {
467467
<Table aria-label="Selectable table">
468468
<Thead>
469469
<Tr>
470-
<Th />
470+
<Th screenReaderText="Row select" />
471471
<Th width={20}>{columnNames.name}</Th>
472472
<Th width={10}>{columnNames.threads}</Th>
473473
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/Filters/examples/FilterMixedSelectGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ export const FilterMixedSelectGroup: React.FunctionComponent = () => {
517517
<Table aria-label="Selectable table">
518518
<Thead>
519519
<Tr>
520-
<Th />
520+
<Th screenReaderText="Row select" />
521521
<Th width={20}>{columnNames.name}</Th>
522522
<Th width={10}>{columnNames.threads}</Th>
523523
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/Filters/examples/FilterSameSelectGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export const FilterSameSelectGroup: React.FunctionComponent = () => {
490490
<Table aria-label="Selectable table">
491491
<Thead>
492492
<Tr>
493-
<Th />
493+
<Th screenReaderText="Row select" />
494494
<Th width={20}>{columnNames.name}</Th>
495495
<Th width={10}>{columnNames.threads}</Th>
496496
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/Filters/examples/FilterSearchInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export const FilterSearchInput: React.FunctionComponent = () => {
298298
<Table aria-label="Selectable table">
299299
<Thead>
300300
<Tr>
301-
<Th />
301+
<Th screenReaderText="Row select" />
302302
<Th width={20}>{columnNames.name}</Th>
303303
<Th width={10}>{columnNames.threads}</Th>
304304
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/Filters/examples/FilterSingleSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export const FilterSingleSelect: React.FunctionComponent = () => {
362362
<Table aria-label="Selectable table">
363363
<Thead>
364364
<Tr>
365-
<Th />
365+
<Th screenReaderText="Row select" />
366366
<Th width={20}>{columnNames.name}</Th>
367367
<Th width={10}>{columnNames.threads}</Th>
368368
<Th width={10}>{columnNames.apps}</Th>

packages/react-core/src/demos/examples/Card/CardStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const CardStatus: React.FunctionComponent = () => {
9494
<Table variant="compact">
9595
<Thead>
9696
<Tr>
97-
<Th />
97+
<Th screenReaderText="Row expansion" />
9898
{columns.map((column, columnIndex) => (
9999
<Th key={columnIndex} modifier="fitContent">
100100
{column}

packages/react-core/src/demos/examples/Tabs/TabsAndTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export const TablesAndTabs = () => {
230230
<Table aria-label="`Composable` table">
231231
<Thead noWrap>
232232
<Tr>
233-
<Th />
233+
<Th screenReaderText="Row select" />
234234
<Th>{columnNames.name}</Th>
235235
<Th>{columnNames.branches}</Th>
236236
<Th>{columnNames.prs}</Th>

packages/react-integration/cypress/integration/tableselectable.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ describe('Table Selectable Test', () => {
1212
});
1313

1414
it('Check number of columns', () => {
15-
cy.get('thead').find('th').should('have.length', 5);
16-
17-
// There should be a canSelectAll input
18-
cy.get('thead').find('td').should('have.length', 1);
15+
cy.get('thead').find('th').should('have.length', 6);
1916
});
2017

2118
it('Test selectable checkbox', () => {

0 commit comments

Comments
 (0)