Skip to content

Commit 178da0a

Browse files
committed
pass headerHeight
1 parent 9654e0e commit 178da0a

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
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.1
4+
5+
_2024-06-17_
6+
7+
### Bugfix
8+
9+
- `headerHeight` is now passed down appropriately
10+
- less opinionated header styles
11+
312
## 0.6.0
413

514
_2024-06-74_

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.0",
3+
"version": "0.6.1",
44
"description": "A React table inspired by react-window",
55
"author": "Mckervin Ceme <mckervinc@live.com>",
66
"license": "MIT",

src/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const HeaderCell = React.memo(function <T>({ column, width, prevWidth }: HeaderC
8686

8787
HeaderCell.displayName = "HeaderCell";
8888

89-
const Header = forwardRef(({ children, ...rest }: HeaderProps, ref: any) => {
89+
const Header = forwardRef(({ children, ...rest }: HeaderProps, ref: React.ForwardedRef<HTMLDivElement>) => {
9090
// hooks
9191
const {
9292
uuid,
@@ -98,7 +98,7 @@ const Header = forwardRef(({ children, ...rest }: HeaderProps, ref: any) => {
9898
} = useContext(TableContext);
9999

100100
// variables
101-
const { scrollWidth, clientWidth } = (ref.current || NO_NODE) as HTMLDivElement;
101+
const { scrollWidth, clientWidth } = ((ref as any).current || NO_NODE) as HTMLDivElement;
102102
const width = scrollWidth <= clientWidth ? "100%" : undefined;
103103
const stickyStyle: React.CSSProperties = {
104104
zIndex: columns.find(c => c.frozen) ? 2 : undefined

src/Table.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ const Table = forwardRef(function <T>(
397397
borders={borders}
398398
width={width}
399399
height={height}
400+
headerHeight={headerHeight}
400401
footerComponent={footerComponent}
401402
{...rest}
402403
/>

src/main.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
}
3737

3838
.rft-header-cell-text {
39-
font-weight: bold;
40-
color: #7d7d7d;
4139
overflow: hidden;
4240
text-overflow: ellipsis;
4341
}

0 commit comments

Comments
 (0)