Skip to content

Commit 14efa6d

Browse files
author
Mathis Neumann
committed
support scrollTo() for window scrolling
1 parent 2a92dab commit 14efa6d

File tree

1 file changed

+6
-1
lines changed
  • packages/react-native-web/src/exports/ScrollView

1 file changed

+6
-1
lines changed

packages/react-native-web/src/exports/ScrollView/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ const ScrollView = createReactClass({
6666
},
6767

6868
getScrollableNode(): any {
69-
return findNodeHandle(this._scrollViewRef);
69+
// when window scrolling is enabled, the scroll node is not the div, but the full page
70+
if (this.props.useWindowScrolling) {
71+
return window.document.documentElement;
72+
} else {
73+
return findNodeHandle(this._scrollViewRef);
74+
}
7075
},
7176

7277
getInnerViewNode(): any {

0 commit comments

Comments
 (0)