Skip to content

Commit 03db961

Browse files
committed
update sticky header height
1 parent c4ab017 commit 03db961

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## 0.6.4
4+
5+
_2024-12-09_
6+
7+
### Bugfix
8+
9+
- Force the sticky header to be the size of the rendered header
10+
- Make sure footer width is 0 when not present
11+
312
## 0.6.3
413

514
_2024-12-04_

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-fluid-table",
3-
"version": "0.6.3",
3+
"version": "0.6.4",
44
"description": "A React table inspired by react-window",
55
"author": "Mckervin Ceme <mckervinc@live.com>",
66
"license": "MIT",

src/Footer.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,15 @@ const Footer = () => {
4646
const ref = useRef<HTMLDivElement>(null);
4747

4848
// constants
49+
const hasFooter = !!FooterComponent || !!columns.find(c => !!c.footer);
4950
const style: React.CSSProperties = {
5051
minWidth: stickyFooter ? undefined : pixelWidths.reduce((pv, c) => pv + c, 0),
5152
...footerStyle
5253
};
54+
if (!hasFooter) {
55+
style.width = 0;
56+
style.minWidth = 0;
57+
}
5358

5459
// functions
5560
const onScroll = useCallback(

src/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const Header = forwardRef(
101101
(ref as React.MutableRefObject<HTMLDivElement>).current || NO_NODE;
102102
const width = scrollWidth <= clientWidth ? "100%" : undefined;
103103
const stickyStyle: React.CSSProperties = {
104+
height,
104105
zIndex: columns.find(c => c.frozen) ? 2 : undefined
105106
};
106107

0 commit comments

Comments
 (0)