diff --git a/semcore/data-table/src/components/Body/Body.tsx b/semcore/data-table/src/components/Body/Body.tsx index 5b6059f851..ec97cb8dd3 100644 --- a/semcore/data-table/src/components/Body/Body.tsx +++ b/semcore/data-table/src/components/Body/Body.tsx @@ -148,6 +148,26 @@ class BodyRoot extends Component { + const { headerHeight: propsHeaderHeight, tableContainerRef, stickyHeader } = this.asProps; + + let headerHeight = propsHeaderHeight; + + if (stickyHeader) { + return headerHeight; + } + + if (tableContainerRef.current) { + if (tableContainerRef.current.scrollTop > headerHeight) { + headerHeight = 0; + } else { + headerHeight = headerHeight - tableContainerRef.current.scrollTop; + } + } + + return headerHeight; + }; + render() { const SBody = Root; const SRowGroup = Box; @@ -155,7 +175,6 @@ class BodyRoot extends Component extends Component extends Component