-
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
Resetting components tabs no longer removes tab from UI - 1.1.16-11 #1419
Comments
The same problem here. Works with 1.1.16, but not with 1.1.16-11. |
Ironically my workaround to allow me to grab new versions of ng2-bootstrap is now to add:
|
similar issue with |
@slubowsky I had to remove this because of another issue, with multiply events triggering on page destroy >.< |
@valorkin I know. I authored that issue :) but I have a workaround in place for that one already (see that issue where someone discusses something similar to what I did) so basically just reverting back to that state for now. |
Why not just have TabDirective.OnDestroy pass a flag that says not to event the removal or something simple like that? |
@slubowsky 's suggestion, in my opinion, is the best way to solve it. Here are my analysis and current workaround: I think the root of the problem is there are two sets of 'tabs' being maintained, one is the 'tabs' provided/maintained by our client code(let's call it Analysis: In order for the library to function properly, we have to guarantee that these two sets of 'tabs' are synced probably, which means:
In the previous version, 1 and 2 are well maintained. The problem is with 3, as the
and our client code is unable (at least not as I can perceive) to distinguish these two scenarios, thereafter, we cannot maintain our
This was broken because in the previous version, when switching to another route, By removing the
because when a Current workaround: When a
then
Notice this |
Thanks for the guidance, guys! In Typescript I am doing this to get hold of Tabset component: export class PriorityDataComponent implements OnInit { and this to replace old tabs with new ones:
// Clear old tabs // Insert new tabs
Sorry I that I did not know how to format the code properly! |
I'm having this issue on 1.3.1 as well. Any signs of it being officially fixed? |
Not yet |
What's the current state on this? I am also facing this issue right now! edit: I fixed this by accident. Since my data loads async I remove the tabset (using *ngIf) during loading, to show a progress bar. after loading finishs the tabset gets build newly and all the old tabs are gone!
So just use a boolean on ngIf that you toggle when you are changing your data! |
While trying to hack TabDirective, I found another Bootstrap feature that could achieve similar results: Import ButtonsModule as usual,
Then simply use it like so:
We add a (click) event to fire off a method |
Any news about this bug? I still have it in version 1.6.6 |
The fact this still exists, is stupid... I think i'll use some other framework. |
fix published in v1.7+ |
fixed by #1941 |
Look like fix to #696 (thanks BTW) may have broken something.
Changing a components tabs no longer causes the old tabs to go away.
HTML
Component
private tabs: any[];
...
in ngOnInit
this.tabs = [...]
at some point in the future
this.tabs = [...]
Original tabs from onInit should go away and be replaced with new tabs. Instead original tabs are still on screen along with new ones.
(Actual use case is my workaround described in #699 where I veto tab selection by replacing the current tab state with the previous tab state. This seems to be a bug in any case but perhaps its time for me to revisit that, maybe something has changed since then)
The text was updated successfully, but these errors were encountered: