Skip to content

Commit

Permalink
Fix autoscroll
Browse files Browse the repository at this point in the history
  • Loading branch information
gitim committed Dec 10, 2016
1 parent 0b3e88a commit 46d4964
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SortableList.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ export default class SortableList extends Component {

// Scroll if the row is not visible.
if (
keyY < this.state.contentOffset.y ||
keyY > this.state.contentOffset.y + containerLayout.height
keyY < this._contentOffset.y ||
keyY > this._contentOffset.y + containerLayout.height
) {
this._contentOffset = {
x: this.state.contentOffset.x,
x: this._contentOffset.x,
y: keyY,
};
this._scroll(animated);
Expand Down Expand Up @@ -427,7 +427,7 @@ export default class SortableList extends Component {
};

_onScroll = ({nativeEvent: {contentOffset}}) => {
this.setState({contentOffset});
this._contentOffset = contentOffset;
};

_onRefContainer = (animatedComponent) => {
Expand Down

0 comments on commit 46d4964

Please sign in to comment.