Skip to content
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

ng2-bootstrap tab select event fire multiple time #2005

Closed
bschauhan opened this issue May 29, 2017 · 3 comments · Fixed by #2361
Closed

ng2-bootstrap tab select event fire multiple time #2005

bschauhan opened this issue May 29, 2017 · 3 comments · Fixed by #2361

Comments

@bschauhan
Copy link

bschauhan commented May 29, 2017

i am use ng2-bootstrap tabs in our project. But, tab select event call multiple time. How to resolve it?

HTML Code:

<tabset [justified]="true" #staticTabs>
    <tab (select)="changeTab('teamtab',$event)" [active]="isCurrentTab == 'teamtab'">
        <!-- More Code -->
    </tab>
    <tab (select)="changeTab('formtab',$event)" [active]="isCurrentTab == 'formtab'">
        <!-- More Code -->
    </tab>
</tabset>

Component code:

changeTab(type, e){
    console.log(e);
}
@akmittal
Copy link

akmittal commented Jul 3, 2017

It is duplicate of #1820 and #1129

@akmittal
Copy link

akmittal commented Jul 3, 2017

Plunker to replicate issue

Workaround

changeTab(type, e){
   if (!e.tabset) return;
    console.log(e);
}

@dave0688
Copy link

dave0688 commented Mar 5, 2018

I think I found an edge case here:

It still fires multiple requests for me in the following scenario:
I have a form in each tab. When an input is focused, and I jump into the next input with tab (AND that input where I jumped in is NOT empty), then it fires the event three times.

The workaround works for me. Still would be nice if someone could fix that.

Thanks :)

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

Successfully merging a pull request may close this issue.

4 participants