From 6f37e136112fd928331cc0352137682293addd82 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 6 May 2025 18:54:10 -0700 Subject: [PATCH] additional fix to sticky table header to account for native --- .../hooks/use-fixed-table-header.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/virtual-table/hooks/use-fixed-table-header.tsx b/src/renderer/components/virtual-table/hooks/use-fixed-table-header.tsx index 1042e9f0..4edeb66f 100644 --- a/src/renderer/components/virtual-table/hooks/use-fixed-table-header.tsx +++ b/src/renderer/components/virtual-table/hooks/use-fixed-table-header.tsx @@ -30,14 +30,26 @@ export const useFixedTableHeader = ({ enabled }: { enabled: boolean }) => { const root = document.querySelector('main .ag-root'); if (!isTableHeaderInView && isTableInView) { - header?.classList.add('ag-header-fixed', 'ag-header-window-bar'); + header?.classList.add('ag-header-fixed'); root?.classList.add('ag-header-fixed-margin'); + + if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) { + header?.classList.add('ag-header-window-bar'); + } } else if (!isTableInView) { header?.classList.remove('ag-header-fixed'); root?.classList.remove('ag-header-fixed-margin'); + + if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) { + header?.classList.remove('ag-header-window-bar'); + } } else if (isTableHeaderInView) { - header?.classList.remove('ag-header-fixed', 'ag-header-window-bar'); + header?.classList.remove('ag-header-fixed'); root?.classList.remove('ag-header-fixed-margin'); + + if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) { + header?.classList.remove('ag-header-window-bar'); + } } }, [enabled, isTableHeaderInView, isTableInView, windowBarStyle]);