Tab bar on active Tab doesn't start at initialPage
Pushing this issue #665
react: 16.0.0-alpha.6 react-native: 0.44.0 native-base: 2.1.5
Expected Behavior: Tab bar should be under the tab that initialPage is set to
Actual Behavior: The content is displayed of the initial Page but the bar is in the 0 position always, scrolling horizontal slightly makes the bar update to the correct place.
Platform: Only have tried IOS, not sure if it doesn't work in android.
Note: I'm more than willing to fix this myself and submit a PR but I'm not sure where the bar on the active Tab is generated, I've attempted to trace the code but couldn't find it. If anyone can point out where that is created I can probably fix this myself and submit a PR. Thanks!
Hey guys, first, you did great work on this library!
I just want to check what the current status of this issue is?
@shivrajkumar, I saw you self-assigned it. Any progress? :)
hey guys, anyone can add this feature please? any updates?
@xempie There is a PR open for it Soon we will merge it
Was this fixed? When will it be merged? Or else, how can I manually do a temporary fix?
@leekuo Merging it this week
Thank you very much @SupriyaKalghatgi ! Native base is incredible to use so far and am eagerly anticipating this fix so we can deploy our first react native app!
@leekuo Happy to hear that
Any updates on the new release that will fix this?
Merging it today
was this merged?
PR has some issue #1376 #1443
Fixed with 2.3.6
Trying out the new 2.3.6 release. The tab content does render correctly instead of blank when initialPage is set. But the selected tab underline still incorrectly underlines the first tab. Anyone else seeing this issue?
Edit: Well I have solved this problem by removing initialPage, creating a ref to the Tabs component, and then calling goToPage() function in the parent component's componentDidMount(). Seems to work so far.
@leekuo Can you provide an example please? Thx a ton!
@leekuo https://github.com/GeekyAnts/NativeBase/issues/1010#issuecomment-354988401
This problem persists on 2.3.6 and 2.3.7. Setting initialPage to other than zero triggers all problems described here.
I've followed the steps @leekuo proposed, but in my case I've had to put a setTimeout to make it work. Ugly, but it is working. If I could manage to skip the animation triggered by goToPage() I could make this issue go unnoticed until we find a fix.
@ziudeso If you still interested in an example
class Home extends Component {
componentDidMount(){
setTimeout(this._tabs.goToPage.bind(this._tabs,1))
}
render(){
return <Tabs ref={component => this._tabs = component}>
//individual tabs here
</Tabs>
}
}
Hopefully, this example can lead you guys to find a permanent solution - a setTimeout delaying the execution of goToTabs() and fixing the problem could mean that something isn't firing before the component mounts.
Thanks everyone!
U are the best @Yarkhan! thanks a lot!
I have much of the same issues. On IOS the first page is rendered ok. On Android (emulator, API 24) the first page is not drawn corretly. The second, third etc. pages are drawn correctly. Example:
Images illustrating the issue https://drive.google.com/open?id=1qrVzsjj9a-uuqEJkRXAEkQzRtCz9yiDZ
Package "expo": "^24.0.0", "native-base": "^2.3.7", "react": "16.0.0", "react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz",
@SupriyaKalghatgi Which click event works on the tab?
@SupriyaKalghatgi How to listen when changing tab?