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-tabset: problems when dynamically adding and removing tabs #6077

@bolemeus

Description

@bolemeus

Bug description:

I have a uib-tabset on my site where there is a fixed first tab, from where I can open additional tabs.
These additional tabs can be closed.
It appears uib-tabset messes up the id's of these new tabs.

The index is set with index = "$index+1", much like the example in the documentation. But it seems that this index is completely ignored, or it is used in some way that I don't understand.
When removing tabs the $index changes, but the active tab index's do not.
Because of this it can happen that you have an active set of tabs with the following index's.

[0, 1, 3, 7, 8]

This would not be such a big deal, but what happens when you add more tabs is more worrying. You'd get the following id's after adding a couple of new tabs.

[0, 1, 3, 7, 8, 5, 6, 7, 8]

You can get duplicate index's this way, resulting in buggy behaviour.

It's probably best to just show the plunkr. See below...

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/RgWAhoZT6F6ORDcqxz6g?p=preview

Version of Angular, UIBS, and Bootstrap

Angular: 1.4.7

UIBS: 1.2.1

Bootstrap: 3.3.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions