Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit f81e4cf

Browse files
authored
Merge pull request #34 from tianzhich/fix-scroll-on-drag
fix: fix the scroll on drag issue
2 parents 08112b2 + 2261bbd commit f81e4cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/react-sortable-tree.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,13 @@ class ReactSortableTree extends Component {
211211
this.scrollZoneVirtualList = (createScrollingComponent || withScrolling)(
212212
React.forwardRef((props, ref) => {
213213
const { dragDropManager, rowHeight, ...otherProps } = props
214-
return <Virtuoso ref={this.listRef} {...otherProps} />
214+
return (
215+
<Virtuoso
216+
ref={this.listRef}
217+
scrollerRef={(scrollContainer) => (ref.current = scrollContainer)}
218+
{...otherProps}
219+
/>
220+
)
215221
})
216222
)
217223
this.vStrength = createVerticalStrength(slideRegionSize)

0 commit comments

Comments
 (0)