Self-review

This commit is contained in:
Peter White
2026-03-25 08:18:14 +01:00
parent 138d99aa77
commit f69333aeb4
2 changed files with 12 additions and 7 deletions
@@ -73,15 +73,22 @@ export function StickyViewGrid({ className, header, children }: StickyViewGridPr
useScrollListener(syncStickyLayout, bodyScrollRef);
useEffect(() => {
const elements = [bodyScrollRef.current, bodyTableRef.current].filter(
(element): element is HTMLDivElement => Boolean(element)
);
if (elements.length === 0) {
const bodyScrollElement = bodyScrollRef.current;
const bodyTableElement = bodyTableRef.current;
if (!bodyScrollElement && !bodyTableElement) {
return;
}
const resizeObserver = new ResizeObserver(syncStickyLayout);
elements.forEach((element) => resizeObserver.observe(element));
if (bodyScrollElement) {
resizeObserver.observe(bodyScrollElement);
}
if (bodyTableElement) {
resizeObserver.observe(bodyTableElement);
}
return () => {
resizeObserver.disconnect();
@@ -1,7 +1,5 @@
@reference "../../RootLayout/globals.css";
.tableScrollArea {
animation: detect-scroll linear;
animation-timeline: scroll(self x);
overscroll-behavior-x: none;
}