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 11import TableContext from '../context/TableContext' ;
22import { useContext } from '@rc-component/context' ;
3+ import { useEvent } from 'rc-util' ;
34import React , { useEffect , useRef , useState } from 'react' ;
45import { createPortal } from 'react-dom' ;
56
@@ -41,7 +42,7 @@ export default function useCelResize(
4142
4243 useEffect ( ( ) => removeResizeListener , [ ] ) ;
4344
44- const onResize = ( event : MouseEvent , isResizeEnd ?: boolean ) => {
45+ const onResize = useEvent ( ( event : MouseEvent , isResizeEnd ?: boolean ) => {
4546 const offset = event . pageX - startPageX . current ;
4647 const oldWidth = colsWidths . get ( columnKey ) ;
4748 let newWidth = startRealWidth . current + ( isFixRight ? - offset : offset ) ;
@@ -79,7 +80,7 @@ export default function useCelResize(
7980 } ) ) ;
8081 onColumnResizeComplete ?.( { columnKey, width : newWidth , columnWidths } ) ;
8182 }
82- } ;
83+ } ) ;
8384
8485 const onResizeEnd = ( event : MouseEvent ) => {
8586 setIsResizing ( false ) ;
You can’t perform that action at this time.
0 commit comments