uib-tab index on only some tabs breaks active #6617
Description
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