Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit a96f795

Browse files
authored
Merge pull request #372 from panichevoleg/bugfix/648843-table-wrong-header
WCAG: PreciseUI table has wrong header
2 parents 6c1d1e6 + 01d23e8 commit a96f795

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Precise UI Changelog
22

3+
## 2.1.10
4+
5+
- Fix WCAG error: Empty table header
6+
37
## 2.1.9
48

59
- Fixed `arrowToggle` on `AccordionTable`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "precise-ui",
3-
"version": "2.1.9",
3+
"version": "2.1.10",
44
"description": "Precise UI React component library powered by Styled Components.",
55
"keywords": [
66
"react",

src/components/Table/TableBasic.part.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const StyledTable = styled.table<StyledTableProps>(
4242
border: ${borderless ? 'none' : theme.tableBorder};
4343
4444
> thead > tr > th,
45+
> thead > tr > td,
4546
> tbody > tr > td {
4647
padding: ${condensed ? `${distance.small} ${distance.large}` : theme.tableHeadPadding};
4748
@@ -245,8 +246,11 @@ export class TableBasic<T> extends React.Component<TableProps<T> & RefProps, Tab
245246
const width = typeof column === 'string' ? undefined : column.width;
246247
const sortable = this.isSortable(key, columns);
247248
const direction = sortable && sortBy && (sortBy.columnKey !== key ? undefined : sortBy.order);
249+
const headTag = `${name}`.trim() ? 'th' : 'td';
250+
248251
return (
249252
<StyledTableHeader
253+
as={headTag}
250254
sortable={sortable}
251255
width={width}
252256
key={key}

0 commit comments

Comments
 (0)