Skip to content

Commit

Permalink
fix(table): fix table crash when rootThWidthList is empty object (#2889)
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn authored May 10, 2024
1 parent 9640bbf commit 003cf23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/table/hooks/useFixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ export default function useFixed(
reduceWidth += thWidthList[key];
});
const rootThWidthList = pick(thWidthList, preColKeys);
if (!Object.values(rootThWidthList).length) return;
const oldTotalWidth = Object.values(rootThWidthList).reduce((r = 0, n) => r + n);
// 保留原有可能编辑过的列宽度,但是当剩余列过小时,表头小于内容宽,需要缩放回内容宽度
// 使用不包含滚动条的可视化区域宽度,意味着当不再溢出的时候,将宽度设置回完整宽度
Expand Down

0 comments on commit 003cf23

Please sign in to comment.