File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
import TableContext from '../context/TableContext' ;
2
2
import { useContext } from '@rc-component/context' ;
3
+ import { useEvent } from 'rc-util' ;
3
4
import React , { useEffect , useRef , useState } from 'react' ;
4
5
import { createPortal } from 'react-dom' ;
5
6
@@ -41,7 +42,7 @@ export default function useCelResize(
41
42
42
43
useEffect ( ( ) => removeResizeListener , [ ] ) ;
43
44
44
- const onResize = ( event : MouseEvent , isResizeEnd ?: boolean ) => {
45
+ const onResize = useEvent ( ( event : MouseEvent , isResizeEnd ?: boolean ) => {
45
46
const offset = event . pageX - startPageX . current ;
46
47
const oldWidth = colsWidths . get ( columnKey ) ;
47
48
let newWidth = startRealWidth . current + ( isFixRight ? - offset : offset ) ;
@@ -79,7 +80,7 @@ export default function useCelResize(
79
80
} ) ) ;
80
81
onColumnResizeComplete ?.( { columnKey, width : newWidth , columnWidths } ) ;
81
82
}
82
- } ;
83
+ } ) ;
83
84
84
85
const onResizeEnd = ( event : MouseEvent ) => {
85
86
setIsResizing ( false ) ;
You can’t perform that action at this time.
0 commit comments