Skip to content

Commit 7c11736

Browse files
authored
fix: scroll logic (#1239)
* fix: scroll logic * fix: ci
1 parent d218893 commit 7c11736

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ name: ✅ test
22
on: [push, pull_request]
33
jobs:
44
test:
5-
uses: react-component/rc-test/.github/workflows/test.yml@main
5+
uses: react-component/rc-test/.github/workflows/test-npm.yml@main
66
secrets: inherit

src/stickyScrollBar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import TableContext from './context/TableContext';
66
import { useLayoutState } from './hooks/useFrame';
77
import raf from '@rc-component/util/lib/raf';
88
import { getOffset } from './utils/offsetUtil';
9+
import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode';
910

1011
const MOUSEUP_EVENT: keyof WindowEventMap = 'mouseup';
1112
const MOUSEMOVE_EVENT: keyof WindowEventMap = 'mousemove';
@@ -153,8 +154,8 @@ const StickyScrollBar: React.ForwardRefRenderFunction<unknown, StickyScrollBarPr
153154
React.useEffect(() => {
154155
if (!scrollBodyRef.current) return;
155156

156-
const scrollParents: HTMLElement[] = [];
157-
let parent: HTMLElement = scrollBodyRef.current;
157+
const scrollParents: (HTMLElement | SVGElement)[] = [];
158+
let parent = getDOM(scrollBodyRef.current);
158159
while (parent) {
159160
scrollParents.push(parent);
160161
parent = parent.parentElement;

0 commit comments

Comments
 (0)