File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ export default function useCelResize(
52
52
const offset = event . pageX - startPageX . current ;
53
53
const oldWidth = colsWidthsRef . current . get ( columnKey ) ;
54
54
let newWidth = startRealWidth . current + ( isFixRight ? - offset : offset ) ;
55
- const index = colsKeys . findIndex ( key => key === columnKey ) ;
56
55
57
56
const minWidth = typeof resizable === 'object' ? resizable . minWidth || 0 : 0 ;
58
57
if ( newWidth < minWidth ) {
@@ -71,6 +70,7 @@ export default function useCelResize(
71
70
let addWidthColumnKey : React . Key ;
72
71
const isDecreasingWidth = oldWidth - newWidth > 0 ;
73
72
if ( smallThanWidth > 0 && isDecreasingWidth ) {
73
+ const index = colsKeys . findIndex ( key => key === columnKey ) ;
74
74
addWidthColumnKey = colsKeys [ index + 1 ] ?? colsKeys [ index - 1 ] ;
75
75
}
76
76
You can’t perform that action at this time.
0 commit comments