File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 57
57
"@rc-component/context" : " ^1.4.0" ,
58
58
"classnames" : " ^2.2.5" ,
59
59
"rc-resize-observer" : " ^1.1.0" ,
60
- "rc-util" : " ^5.41.0 " ,
60
+ "rc-util" : " ^5.44.3 " ,
61
61
"rc-virtual-list" : " ^3.14.2"
62
62
},
63
63
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
import { useContext } from '@rc-component/context' ;
2
2
import classNames from 'classnames' ;
3
3
import addEventListener from 'rc-util/lib/Dom/addEventListener' ;
4
- import { getOffset } from 'rc-util/lib/Dom/css' ;
5
4
import getScrollBarSize from 'rc-util/lib/getScrollBarSize' ;
6
5
import * as React from 'react' ;
7
6
import TableContext from './context/TableContext' ;
8
7
import { useLayoutState } from './hooks/useFrame' ;
9
8
import raf from 'rc-util/lib/raf' ;
9
+ import { getOffset } from './utils/offsetUtil' ;
10
10
11
11
interface StickyScrollBarProps {
12
12
scrollBodyRef : React . RefObject < HTMLDivElement > ;
Original file line number Diff line number Diff line change
1
+ import { getDOM } from 'rc-util/lib/Dom/findDOMNode' ;
2
+
3
+ // Copy from `rc-util/Dom/css.js`
4
+ export function getOffset ( node : HTMLElement | Window ) {
5
+ const element = getDOM ( node ) ;
6
+ const box = element . getBoundingClientRect ( ) ;
7
+ const docElem = document . documentElement ;
8
+
9
+ // < ie8 not support win.pageXOffset, use docElem.scrollLeft instead
10
+ return {
11
+ left :
12
+ box . left +
13
+ ( window . pageXOffset || docElem . scrollLeft ) -
14
+ ( docElem . clientLeft || document . body . clientLeft || 0 ) ,
15
+ top :
16
+ box . top +
17
+ ( window . pageYOffset || docElem . scrollTop ) -
18
+ ( docElem . clientTop || document . body . clientTop || 0 ) ,
19
+ } ;
20
+ }
You can’t perform that action at this time.
0 commit comments