additional fix to sticky table header to account for native

This commit is contained in:
jeffvli 2025-05-06 18:54:10 -07:00
parent 3c494f1c72
commit 6f37e13611

View file

@ -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]);