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 5757 "@rc-component/context" : " ^1.4.0" ,
5858 "classnames" : " ^2.2.5" ,
5959 "rc-resize-observer" : " ^1.1.0" ,
60- "rc-util" : " ^5.41.0 " ,
60+ "rc-util" : " ^5.44.3 " ,
6161 "rc-virtual-list" : " ^3.14.2"
6262 },
6363 "devDependencies" : {
Original file line number Diff line number Diff line change 11import { useContext } from '@rc-component/context' ;
22import classNames from 'classnames' ;
33import addEventListener from 'rc-util/lib/Dom/addEventListener' ;
4- import { getOffset } from 'rc-util/lib/Dom/css' ;
54import getScrollBarSize from 'rc-util/lib/getScrollBarSize' ;
65import * as React from 'react' ;
76import TableContext from './context/TableContext' ;
87import { useLayoutState } from './hooks/useFrame' ;
98import raf from 'rc-util/lib/raf' ;
9+ import { getOffset } from './utils/offsetUtil' ;
1010
1111interface StickyScrollBarProps {
1212 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