Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Using both InteractionManager and timeout
  • Loading branch information
Gianmarco Leone committed Jan 30, 2017
commit fc7b1c40c38e1c41f0bc6d47eb9cafb8171af77e
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ const ScrollableTabView = React.createClass({
},

componentDidMount() {
this.setTimeout(() => {
const scrollFn = () => {
if (this.scrollView && Platform.OS === 'android') {
const x = this.props.initialPage * this.state.containerWidth;
this.scrollView.scrollTo({ x, animated: false });
}
};
this.setTimeout(() => {
InteractionManager.runAfterInteractions(scrollFn);
}, 0);
},

Expand Down