Skip to content

Commit

Permalink
chore: update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi committed Apr 8, 2024
1 parent ba19cac commit 126811e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cell/useCellResize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default function useCelResize(
const offset = event.pageX - startPageX.current;
const oldWidth = colsWidthsRef.current.get(columnKey);
let newWidth = startRealWidth.current + (isFixRight ? -offset : offset);
const index = colsKeys.findIndex(key => key === columnKey);

const minWidth = typeof resizable === 'object' ? resizable.minWidth || 0 : 0;
if (newWidth < minWidth) {
Expand All @@ -71,6 +70,7 @@ export default function useCelResize(
let addWidthColumnKey: React.Key;
const isDecreasingWidth = oldWidth - newWidth > 0;
if (smallThanWidth > 0 && isDecreasingWidth) {
const index = colsKeys.findIndex(key => key === columnKey);
addWidthColumnKey = colsKeys[index + 1] ?? colsKeys[index - 1];
}

Expand Down

0 comments on commit 126811e

Please sign in to comment.