TabBar: Android - on react-native: 0.59.0-rc.2: on press on tab first time it pass to other tab but from then it stuck.
On react-native 0.58.4 it's OK
Only on Android! On iOS it's OK
On press tab it pass to another tab
<TabView
useNativeDriver
navigationState={this.state}
renderScene={this._renderScene}
onIndexChange={this.changeRoute}
renderTabBar={(props) => {
return (<View style={{paddingHorizontal: layoutPaddingHorizontal, width: Dimensions.get('screen').width}}>
<TabBar
{...props}
renderIndicator={this._renderIndicator}
renderLabel={this._renderLabel}
style={{backgroundColor: 'white', shadowOpacity: 0, elevation: 0}}
indicatorStyle={{backgroundColor: "blue"}}
labelStyle={{
color: "blue",
fontSize: 15
}}
/>
</View>)
}}
/>
Pressing on tab label No. 2 and it pass.
Pressing on tab label No. 3 and it not pass.
Pressing on tab label No. 2 and not pass.
Pressing on tab label No. 1 and not pass.
go back
Pressing on tab label No. 3 and it pass.
Pressing on tab label No. 2 and not pass.
Pressing on tab label No. 1 and not pass.
| software | version
| --------------------- | -------
| ios or android | Android
| react-native | "0.59.0-rc.2"
| react-native-tab-view | "1.3.2"
| node | 8.11.4
| npm or yarn | yarn
Also happened in react-native: 0.59.0-rc.0 and react-native: 0.59.0-rc.1
Hey, I just released a new alpha 2.0.0-alpha.0 of the library. It's rewritten using react-native-gesture-handler and react-native-reanimated addresses a many platform specific bugs and performance problems. The documentation is updated as well.
Please try the new version and see if it addresses your issue. If not, please open a new issue following the issue template.
Just in case anyone else has this issue, the problem exists in PagerAndroid.js file, specifically the _handlePageScrollStateChanged function.
this._isIdle = e === 'idle';
can be changed to:
this._isIdle = e.nativeEvent.pageScrollState === 'idle';
That sorted the issue for us. I would open a pull request however I am unsure if the 1.x branch is still being maintained.
You can try this https://github.com/react-native-community/react-native-tab-view/issues/525#issuecomment-509942001
Most helpful comment
Just in case anyone else has this issue, the problem exists in PagerAndroid.js file, specifically the _handlePageScrollStateChanged function.
this._isIdle = e === 'idle';can be changed to:
this._isIdle = e.nativeEvent.pageScrollState === 'idle';That sorted the issue for us. I would open a pull request however I am unsure if the 1.x branch is still being maintained.