-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs fire off activations during OnDestroy #696
Comments
ok, got it |
Any news on this? I need this to update the route on tab select, however when it's destroyed it navigates to the route defined in the (select) event handler. Currently I'm using (click) on the heading span to do that (which is not ideal since it doesn't cover the entire tab heading section). Thanks :) |
I do need this fixed too; I have the same issue as PEsteves8. |
Seeing the same issue. Would like to see it fixed. |
Any update on this? Having the same issue and hope it gets fixed soon. |
This is the workaround that works for me. I use tab with (select) event to navigate between tabs using angular route.
|
@ipassynk do you set |
yes, it is false on init. As soon as a router navigation started I do not want to receive 'select' event from tabs component and isNavigation flag does the trick for me. |
My solution: I changed the source node_modules\ng2-bootstrap\components\tabs\tabset.component.js, This might affect, thought, cases where you dynamically add/remove tabs, but it worked fine for me. |
Found a simple fix:
Not sure whether this would break other stuff, but it works for me. |
@xwb1989 simple and good solution, let's try |
Hope this can go into next release, then I can remove this hack patch from my code 😃 |
TabDirective.ngOnDestroy calls TabsetComponent.removeTab which checks if this.isDestroyed before continuing on and causing the next tab to be activated. The TabsetComponent component sets isDestroyed to true in ngOnDestroy. SO it appears that no events should be fired during compnent tear down.
Unfortunately it appears to me (using 2.0.0-rc.4) that OnDestroy is called in reverse order. First each tab then the tabset (and then my component which contains them)
I see the same behavior when putting breakpoints in the ng2-bootstrap demo page and watch things deconstruct from the tabs page when I click on another link.
See also #610 which sounds very similar
The text was updated successfully, but these errors were encountered: