Skip to content

Commit 46d4964

Browse files
committed
Fix autoscroll
1 parent 0b3e88a commit 46d4964

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SortableList.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ export default class SortableList extends Component {
119119

120120
// Scroll if the row is not visible.
121121
if (
122-
keyY < this.state.contentOffset.y ||
123-
keyY > this.state.contentOffset.y + containerLayout.height
122+
keyY < this._contentOffset.y ||
123+
keyY > this._contentOffset.y + containerLayout.height
124124
) {
125125
this._contentOffset = {
126-
x: this.state.contentOffset.x,
126+
x: this._contentOffset.x,
127127
y: keyY,
128128
};
129129
this._scroll(animated);
@@ -427,7 +427,7 @@ export default class SortableList extends Component {
427427
};
428428

429429
_onScroll = ({nativeEvent: {contentOffset}}) => {
430-
this.setState({contentOffset});
430+
this._contentOffset = contentOffset;
431431
};
432432

433433
_onRefContainer = (animatedComponent) => {

0 commit comments

Comments
 (0)