-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Tab selects fired during scope destruction #2155
Comments
@sjdw80 please provide a minimal reproduce scenario using http://plnkr.co/, otherwise we can't help. |
I'll work on that. In the meantime, I've narrowed down the behavior a bit. It looks as though, if I use the $location service within any ng-click functions in the tabset to navigate away from the page, the select function for each tab is fired. |
It doesn't look at though plinkr will let me use the $location service normally, so I can't really demonstrate it there. The problem is with the following line:
Found in TabsetController. It looks as though, when the $location service is used to navigate away, the removeTab function is being called on each tab:
Which will lead to each tab being sequentially "selected" and each tab select function being fired as the user navigates away from the page. |
I am having the same issue. Here is plunk: http://plnkr.co/edit/O8TKIS?p=preview |
Thanks for taking the time to do that, @prettynatty |
Just discovered this issue as well. Since select is fired on every tab on every tab it is hard to keep track of the last selected when redrawing. |
I am changing url on tab select and the app is becoming insane when I destroy scope containing tabs. |
In my case I have two tabs, first tab is default to selected and I have server call wired to each tab's selection. if I leave the page by clicking back button the second tab selected call will be made to the server. This is because when the tab is being destroyed the remaining one wants to be selected automatically. BUT if I change tab then leave the page nothing will happen because the following code only triggers if the active one is removed first(I guess). Just some discoveries
|
- added showcase service - added workaround for tab.select misbehaviour -- issue: angular-ui/bootstrap#2155 -- workaround: use ng-click to signify selection of tab
I have the same problem when I am navigating away from the site where the tabs are located the events are fired. And here the plunk |
I have this issue too I believe. It prevents the user from using the back button on their browser when the back button destination is a state (using ui-router) on a different parent. It appears to go to the correct location but then immediately goes back to the tabs page (without parameters) and fires off all the tab states |
I'm also experiencing this with 0.11.0. I save the current tab to local storage when selected, so this issue is causing the incorrect tab to be stored. |
Same issue and same version as @adressin . |
Hello i fixed by this way (until now work for me) |
i have the same problem but with a modal....when modal close or dismiss, then trigger the tabselected, here is the plunkr: http://plnkr.co/edit/TXBAHvAAnB8xaWoD2dfB?p=preview |
Same here after upgrading to 0.11. @danielgarciagil could you submit a pull request with your fix, please ? |
I ran into this issue today as well. |
Same here when upgrading to 0.11 =[ |
Encountering this bug :( Here is a workaround:
|
The problem is still remaining and did not fix but i made a solution for me to solve the problem: var destroyed = false; 2-I calling destroyTab() rather than removeTab() in $on('$destroy') in tab directive: please see if this solution is proper for the directive or not. |
@mu7amed-abdelfata7 Can you open a new issue with a plunkr please. |
I am not seeing this issue currently here. Feel free to open another issue with a reproduction if possible as suggested. |
After updating to 0.11, I'm having issues with the tab select function.
I have a function as follows:
I'm finding that logOut() fires whenever I click any link in any of the tab content areas.
The text was updated successfully, but these errors were encountered: