From cada8c69ca27f07251c4185871a3e0f59ff86d94 Mon Sep 17 00:00:00 2001 From: Arno V Date: Tue, 16 Apr 2024 18:29:59 -0400 Subject: [PATCH] fix(Table): invalid sort indicator location when sticky is enabled --- packages/documentation/src/Components/Table.stories.tsx | 2 +- packages/ui-components/src/components/private/ButtonSort.tsx | 2 +- .../src/components/private/__tests__/ButtonSort.test.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/documentation/src/Components/Table.stories.tsx b/packages/documentation/src/Components/Table.stories.tsx index 1b30cd53..7e1f3725 100644 --- a/packages/documentation/src/Components/Table.stories.tsx +++ b/packages/documentation/src/Components/Table.stories.tsx @@ -330,7 +330,7 @@ export const WithRowNumbers: Story = (args) => { export const Sortable: Story = (args) => { const [sortState, setSortState] = useState<{ - cell: string | number; + cell: string; direction: | typeof TableCellSortDirections.ASC | typeof TableCellSortDirections.DESC diff --git a/packages/ui-components/src/components/private/ButtonSort.tsx b/packages/ui-components/src/components/private/ButtonSort.tsx index 7ec6282f..23506a0d 100644 --- a/packages/ui-components/src/components/private/ButtonSort.tsx +++ b/packages/ui-components/src/components/private/ButtonSort.tsx @@ -58,10 +58,10 @@ export const ButtonSort = React.forwardRef( ? clsx( "relative", "focus-within:static", + "focus-within:after:border-transparent", "after:absolute", "after:content-['']", "after:border-b-2", - "after:z-[-1px]", "after:bottom-[-4px]", "after:left-0", "after:right-0", diff --git a/packages/ui-components/src/components/private/__tests__/ButtonSort.test.tsx b/packages/ui-components/src/components/private/__tests__/ButtonSort.test.tsx index bb1acbbd..95f08d9b 100644 --- a/packages/ui-components/src/components/private/__tests__/ButtonSort.test.tsx +++ b/packages/ui-components/src/components/private/__tests__/ButtonSort.test.tsx @@ -192,10 +192,10 @@ describe("ButtonSort modifiers", () => { if (parent) { expectToHaveClasses(parent, [ "focus-within:static", + "focus-within:after:border-transparent", "after:absolute", "after:content-['']", "after:border-b-2", - "after:z-[-1px]", "after:bottom-[-4px]", "after:left-0", "after:right-0", @@ -217,10 +217,10 @@ describe("ButtonSort modifiers", () => { if (parent) { expectToHaveClasses(parent, [ "focus-within:static", + "focus-within:after:border-transparent", "after:absolute", "after:content-['']", "after:border-b-2", - "after:z-[-1px]", "after:bottom-[-4px]", "after:left-0", "after:right-0",