Skip to content

Commit 57884a4

Browse files
committed
0.6.1
1 parent 122d4ff commit 57884a4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const ScrollableTabView = React.createClass({
2727
DefaultTabBar,
2828
ScrollableTabBar,
2929
},
30+
scrollOnMountCalled: false,
3031

3132
propTypes: {
3233
tabBarPosition: PropTypes.oneOf(['top', 'bottom', 'overlayTop', 'overlayBottom', ]),
@@ -150,7 +151,11 @@ const ScrollableTabView = React.createClass({
150151
ref={(scrollView) => { this.scrollView = scrollView; }}
151152
onScroll={(e) => {
152153
const offsetX = e.nativeEvent.contentOffset.x;
153-
this._updateScrollValue(offsetX / this.state.containerWidth);
154+
if (offsetX === 0 && !this.scrollOnMountCalled) {
155+
this.scrollOnMountCalled = true;
156+
} else {
157+
this._updateScrollValue(offsetX / this.state.containerWidth);
158+
}
154159
}}
155160
onMomentumScrollBegin={this._onMomentumScrollBeginAndEnd}
156161
onMomentumScrollEnd={this._onMomentumScrollBeginAndEnd}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-scrollable-tab-view",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)