Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: a11y-SR row count announcement in DataTable with expandable rows #18457

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -386,7 +386,9 @@ export const AILabelWithExpansion = (args) => (
<TableBody>
{rows.map((row, i) => (
<React.Fragment key={row.id}>
<TableExpandRow {...getRowProps({ row })}>
<TableExpandRow
{...getRowProps({ row })}
aria-expanded={row.isExpanded}>
{i === 3 || i === 4 || i === 1 ? (
<TableDecoratorRow decorator={aiLabel} />
) : (
@@ -397,6 +399,7 @@ export const AILabelWithExpansion = (args) => (
))}
</TableExpandRow>
<TableExpandedRow
aria-hidden={!row.isExpanded}
colSpan={headers.length + 2}
className="demo-expanded-td"
{...getExpandedRowProps({ row })}>
@@ -456,7 +459,9 @@ export const ColumnAILabelWithSelectionAndExpansion = (args) => (
{rows.map((row) => {
return (
<React.Fragment key={row.id}>
<TableExpandRow {...getRowProps({ row })}>
<TableExpandRow
{...getRowProps({ row })}
aria-expanded={row.isExpanded}>
<TableSelectRow {...getSelectionProps({ row })} />
{row.cells.map((cell) => {
return (
@@ -467,6 +472,7 @@ export const ColumnAILabelWithSelectionAndExpansion = (args) => (
})}
</TableExpandRow>
<TableExpandedRow
aria-hidden={!row.isExpanded}
colSpan={headers.length + 2}
className="demo-expanded-td"
{...getExpandedRowProps({ row })}>
Original file line number Diff line number Diff line change
@@ -249,13 +249,16 @@ export const Default = (args) => {
<TableBody>
{rows.map((row) => (
<React.Fragment key={row.id}>
<TableExpandRow {...getRowProps({ row })}>
<TableExpandRow
{...getRowProps({ row })}
aria-expanded={row.isExpanded}>
<TableSelectRow {...getSelectionProps({ row })} />
{row.cells.map((cell) => (
<TableCell key={cell.id}>{cell.value}</TableCell>
))}
</TableExpandRow>
<TableExpandedRow
aria-hidden={!row.isExpanded}
colSpan={headers.length + 3}
className="demo-expanded-td"
{...getExpandedRowProps({ row })}>
Original file line number Diff line number Diff line change
@@ -83,13 +83,15 @@ export const Default = (args) => (
{rows.map((row) => (
<React.Fragment key={row.id}>
<TableExpandRow
aria-expanded={row.isExpanded}
{...getRowProps({ row })}
onClick={action('onClick')}>
{row.cells.map((cell) => (
<TableCell key={cell.id}>{cell.value}</TableCell>
))}
</TableExpandRow>
<TableExpandedRow
aria-hidden={!row.isExpanded}
colSpan={headers.length + 1}
className="demo-expanded-td"
{...getExpandedRowProps({ row })}>