Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

uib-tab index on only some tabs breaks active #6617

Open
troywoy opened this issue Aug 21, 2017 · 0 comments
Open

uib-tab index on only some tabs breaks active #6617

troywoy opened this issue Aug 21, 2017 · 0 comments

Comments

@troywoy
Copy link

troywoy commented Aug 21, 2017

As seen in this plunkr, when index is defined on one tab all remaining tabs (after the first manually defined index) need an index otherwise the active state of the tab breaks. A suspected culprit is found on this line. Performing Math.max... on an array that contains a string results in the outcome being NaN. Changing that line to be ...tabs.length + 1 works for my environment, but I don't suspect the fix to be that straightforward.

Math.max.apply(null, [1, 2, 3, 4]);
// -> 4

Math.max.apply(null, [1, 2, 3, 'foobar', 4]);
//-> NaN

Our use case is that we have a button somewhere else in the application that brings a "Foobar" tab into view. All other tabs have no use for an index, besides internal logic being broken forcing us to define them.

It is much more developer friendly to make index truly optional for each tab in a tabset.

Angular: 1.6.1
UIBS: 2.5.0
Bootstrap: 3.3.7

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

No branches or pull requests

1 participant