Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was 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

Description

@troywoy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions