Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make no tab selected? #102

Open
danielzzz opened this issue Aug 23, 2018 · 1 comment
Open

make no tab selected? #102

danielzzz opened this issue Aug 23, 2018 · 1 comment

Comments

@danielzzz
Copy link

Question / Problem

Actual behavior

when no activeTab is set there is always the first one selected

Expected behavior

I would like to use this component as a kind of a secondary navigation where the tabs point to some unrelated screens. there is a situation when the current screen is not one of the ones in the bottom nav.
in this case none of the tabs should be set as active, but I am not sure how to achieve that.

thx, dan

@timomeh
Copy link
Owner

timomeh commented Aug 23, 2018

Interesting. I never thought of that use case, but it makes sense. Currently it will switch to uncontrolled mode and set the first tab as active, If you don't set an activeTab.

this.state = {
activeTab: this.isControlled ? props.activeTab : props.tabs[0].key
}

I think it's a valid point to have no tab active, if no activeTab is set. For uncontrolled mode there should be a defaultTab prop.

If you want to, you can contribute by opening a PR to solve this issue. If not, I can take a look at it when I have some time to spare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants