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

The ui.bootstrap.tabs when using ng-repeat #5654

Closed
lunhat79 opened this issue Mar 19, 2016 · 6 comments
Closed

The ui.bootstrap.tabs when using ng-repeat #5654

lunhat79 opened this issue Mar 19, 2016 · 6 comments

Comments

@lunhat79
Copy link

Bug description:

The tab.index of UibTabsetController.tabs array is not set after the tab being destroy.

That cause the index of UibTabsetController.tabs is not correct with the index at View(html).

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/kal8TDVoRLT7417GOLXd

Version of Angular, UIBS, and Bootstrap

Angular: version 1.5.0

Bootstrap: ui-bootstrap-tpls-1.2.4.js

@icfantv
Copy link
Contributor

icfantv commented Mar 19, 2016

At first glance, this looks like a bug.

@lunhat79
Copy link
Author

It is because the index at view is changed, but the index at tabs is not updated.
I think the Index attribute must be watched and update to the tabs.

@wesleycho
Copy link
Contributor

Relying on dynamic index values leads to a world of pain - I'd recommend against doing so. I'm taking a look at potentially allowing dynamic indices, but it looks like it causes far uglier bugs unsurprisingly.

This may potentially be rejected as a not supported case, will look into this a little further.

@wesleycho
Copy link
Contributor

After spending some time working on this and thinking on it, I am going to close this as won't fix. Relying on tab index values being dynamic & not unique is a use case that has fundamental problems when it comes to active state management when tabs are removed and added.

@lunhat79
Copy link
Author

Wesley Cho.
The document say the index is UNIQUE. So i think we could solve the problem by determine the index is unique and the model (scope) is change following the Index.

@krishna-agarwal
Copy link

krishna-agarwal commented Oct 6, 2016

After removing item from tab creating deep copy of array will fix this issue.

Working link :
http://plnkr.co/edit/FRqvpsRGk6HxdrqdTKx6?p=preview

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

No branches or pull requests

4 participants