Skip to content

Commit

Permalink
fix(table): fix that flexGrow and wordWrap cannot be used together (
Browse files Browse the repository at this point in the history
  • Loading branch information
simonguo committed Sep 17, 2021
1 parent 572b1cd commit f91aa2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/md/WordWrapTable.md
Expand Up @@ -36,7 +36,7 @@ const App = () => {
<Cell dataKey="id" />
</Column>

<Column width={130} fixed>
<Column width={130} fixed flexGrow={1}>
<HeaderCell>First Name</HeaderCell>
<Cell dataKey="firstName" />
</Column>
Expand Down Expand Up @@ -65,7 +65,6 @@ const App = () => {
<HeaderCell>Email</HeaderCell>
<Cell dataKey="email" />
</Column>

</Table>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion src/utils/useTableDimension.ts
Expand Up @@ -158,14 +158,16 @@ const useTableDimension = (props: TableDimensionProps) => {
}, [onTableWidthChange, setOffsetByAffix, tableRef]);

useMount(() => {
calculateTableWidth();
calculateTableContextHeight();
calculateTableContentWidth();
calculateTableWidth();
setOffsetByAffix();

bindElementResize(tableRef.current, debounce(calculateTableWidth, 400));
});

useUpdateLayoutEffect(() => {
calculateTableWidth();
calculateTableContextHeight();
calculateTableContentWidth();
}, [
Expand Down

0 comments on commit f91aa2b

Please sign in to comment.