Skip to content

Commit

Permalink
pass headerHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
mckervinc committed Jun 17, 2024
1 parent 9654e0e commit 178da0a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## 0.6.1

_2024-06-17_

### Bugfix

- `headerHeight` is now passed down appropriately
- less opinionated header styles

## 0.6.0

_2024-06-74_
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-fluid-table",
"version": "0.6.0",
"version": "0.6.1",
"description": "A React table inspired by react-window",
"author": "Mckervin Ceme <mckervinc@live.com>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const HeaderCell = React.memo(function <T>({ column, width, prevWidth }: HeaderC

HeaderCell.displayName = "HeaderCell";

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

// variables
const { scrollWidth, clientWidth } = (ref.current || NO_NODE) as HTMLDivElement;
const { scrollWidth, clientWidth } = ((ref as any).current || NO_NODE) as HTMLDivElement;
const width = scrollWidth <= clientWidth ? "100%" : undefined;
const stickyStyle: React.CSSProperties = {
zIndex: columns.find(c => c.frozen) ? 2 : undefined
Expand Down
1 change: 1 addition & 0 deletions src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ const Table = forwardRef(function <T>(
borders={borders}
width={width}
height={height}
headerHeight={headerHeight}
footerComponent={footerComponent}
{...rest}
/>
Expand Down
2 changes: 0 additions & 2 deletions src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
}

.rft-header-cell-text {
font-weight: bold;
color: #7d7d7d;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down

0 comments on commit 178da0a

Please sign in to comment.