Skip to content

Commit

Permalink
Merge pull request #372 from panichevoleg/bugfix/648843-table-wrong-h…
Browse files Browse the repository at this point in the history
…eader

WCAG: PreciseUI table has wrong header
  • Loading branch information
FlorianRappl authored Mar 17, 2022
2 parents 6c1d1e6 + 01d23e8 commit a96f795
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Precise UI Changelog

## 2.1.10

- Fix WCAG error: Empty table header

## 2.1.9

- Fixed `arrowToggle` on `AccordionTable`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "precise-ui",
"version": "2.1.9",
"version": "2.1.10",
"description": "Precise UI React component library powered by Styled Components.",
"keywords": [
"react",
Expand Down
4 changes: 4 additions & 0 deletions src/components/Table/TableBasic.part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const StyledTable = styled.table<StyledTableProps>(
border: ${borderless ? 'none' : theme.tableBorder};
> thead > tr > th,
> thead > tr > td,
> tbody > tr > td {
padding: ${condensed ? `${distance.small} ${distance.large}` : theme.tableHeadPadding};
Expand Down Expand Up @@ -245,8 +246,11 @@ export class TableBasic<T> extends React.Component<TableProps<T> & RefProps, Tab
const width = typeof column === 'string' ? undefined : column.width;
const sortable = this.isSortable(key, columns);
const direction = sortable && sortBy && (sortBy.columnKey !== key ? undefined : sortBy.order);
const headTag = `${name}`.trim() ? 'th' : 'td';

return (
<StyledTableHeader
as={headTag}
sortable={sortable}
width={width}
key={key}
Expand Down

0 comments on commit a96f795

Please sign in to comment.