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

Tab wont active #687

Closed
mifas opened this Issue Jul 12, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@mifas

mifas commented Jul 12, 2017

I've set active property to the second tab, but when page load, its always choosing first one

https://jsfiddle.net/y13jszkq/

@tmorehouse tmorehouse self-assigned this Jul 13, 2017

@tmorehouse tmorehouse added this to the v0.19.0 milestone Jul 13, 2017

@alexsasharegan

This comment has been minimized.

Contributor

alexsasharegan commented Jul 13, 2017

Just tinkering with this, it seems that there's some link with the v-model. It might be necessary for the tab wrapper to have access to a tab index data property so it can know which tab is active.

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Jul 13, 2017

<b-tabs> is supposed to traverse the containing list of <b-tab> components and check their active state, and set the first active one found as active (and clear the rest)..

I think the last fix to prevent two tabs from being in the active state might have affected this.

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Jul 16, 2017

@mifas

Quick workaround before the PR make it into the next release.

<b-tabs :value="null">
  <b-tab title="Login">Login</b-tab>
  <b-tab title="Singup" active>Signup</b-tab>
</b-tabs>

Setting the current tab value to null will force it to look for the first <b-tab> with the active prop set.

Fiddle: https://jsfiddle.net/25jwyoqu/

tmorehouse added a commit that referenced this issue Jul 16, 2017

fix(tabs): Default current tab to null (issue #687) (#701)
* fix(tab): Set localActive to initial active state

* fix(tabs): Default currentTab to null
value defaulted to 0, which prevented tab with `active` state from being shown
@mifas

This comment has been minimized.

mifas commented Jul 26, 2017

@tmorehouse Thanks for the update, Fiddle is working as expected.

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