Skip to content

Commit

Permalink
fix(Table): focus sortable button
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikbacker committed Dec 26, 2024
1 parent 2643c48 commit 5bbdf49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/css/src/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
text-align: inherit;
width: 100%;

@composes ds-focus from './base.css';

&:focus-visible {
position: relative; /* Place on top when painting focus border */
}
Expand Down
8 changes: 1 addition & 7 deletions packages/react/src/components/Table/TableHeaderCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ export const TableHeaderCell = forwardRef<
>(function TableHeaderCell({ sort, children, ...rest }, ref) {
return (
<th aria-sort={sort} ref={ref} {...rest}>
{sort ? (
<button type='button' className='ds-focus'>
{children}
</button>
) : (
children
)}
{sort ? <button type='button'>{children}</button> : children}
</th>
);
});

0 comments on commit 5bbdf49

Please sign in to comment.