mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 08:54:27 +02:00
fix position of sticky table header when titlebar present
This commit is contained in:
@@ -30,13 +30,13 @@ 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');
|
header?.classList.add('ag-header-fixed', 'ag-header-window-bar');
|
||||||
root?.classList.add('ag-header-fixed-margin');
|
root?.classList.add('ag-header-fixed-margin');
|
||||||
} 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');
|
||||||
} else if (isTableHeaderInView) {
|
} else if (isTableHeaderInView) {
|
||||||
header?.classList.remove('ag-header-fixed');
|
header?.classList.remove('ag-header-fixed', 'ag-header-window-bar');
|
||||||
root?.classList.remove('ag-header-fixed-margin');
|
root?.classList.remove('ag-header-fixed-margin');
|
||||||
}
|
}
|
||||||
}, [enabled, isTableHeaderInView, isTableInView, windowBarStyle]);
|
}, [enabled, isTableHeaderInView, isTableInView, windowBarStyle]);
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
transition: position 0.2s ease-in-out;
|
transition: position 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ag-header-window-bar {
|
||||||
|
top: 95px;
|
||||||
|
}
|
||||||
|
|
||||||
.ag-header {
|
.ag-header {
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user