mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
additional fix to sticky table header to account for native
This commit is contained in:
parent
3c494f1c72
commit
6f37e13611
1 changed files with 14 additions and 2 deletions
|
|
@ -30,14 +30,26 @@ export const useFixedTableHeader = ({ enabled }: { enabled: boolean }) => {
|
||||||
const root = document.querySelector('main .ag-root');
|
const root = document.querySelector('main .ag-root');
|
||||||
|
|
||||||
if (!isTableHeaderInView && isTableInView) {
|
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');
|
root?.classList.add('ag-header-fixed-margin');
|
||||||
|
|
||||||
|
if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) {
|
||||||
|
header?.classList.add('ag-header-window-bar');
|
||||||
|
}
|
||||||
} else if (!isTableInView) {
|
} else if (!isTableInView) {
|
||||||
header?.classList.remove('ag-header-fixed');
|
header?.classList.remove('ag-header-fixed');
|
||||||
root?.classList.remove('ag-header-fixed-margin');
|
root?.classList.remove('ag-header-fixed-margin');
|
||||||
|
|
||||||
|
if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) {
|
||||||
|
header?.classList.remove('ag-header-window-bar');
|
||||||
|
}
|
||||||
} else if (isTableHeaderInView) {
|
} 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');
|
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]);
|
}, [enabled, isTableHeaderInView, isTableInView, windowBarStyle]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue