Skip to content

Commit 1297e09

Browse files
committed
update
1 parent bf128c1 commit 1297e09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Header/useCellResize.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default function useCelResize(
6363
// If there is no column on the right, it will be allocated to the column on the left.
6464
let addWidthColumnKey: React.Key;
6565
const isDecreasingWidth = oldWidth - newWidth > 0;
66+
console.log('smallThanWidth', smallThanWidth);
6667
if (smallThanWidth > 0 && isDecreasingWidth) {
6768
const index = colsKeys.findIndex(key => key === columnKey);
6869
addWidthColumnKey = colsKeys[index + 1] ?? colsKeys[index - 1];
@@ -71,7 +72,7 @@ export default function useCelResize(
7172
const columnWidthsMap = new Map(colsWidths);
7273
columnWidthsMap.set(columnKey, newWidth);
7374
if (addWidthColumnKey) {
74-
const addWidthColumnNewWidth = colsWidths.get(addWidthColumnKey) + (oldWidth - newWidth);
75+
const addWidthColumnNewWidth = colsWidths.get(addWidthColumnKey) + smallThanWidth;
7576
columnWidthsMap.set(addWidthColumnKey, addWidthColumnNewWidth);
7677
}
7778
const columnWidths = Array.from(columnWidthsMap).map(([key, width]) => ({

0 commit comments

Comments
 (0)