Ngx-bootstrap: how to use Manual selection of tabs in modals

Created on 3 Jan 2019  路  2Comments  路  Source: valor-software/ngx-bootstrap

I am trying to use Manual selection of tabs. It works in template.

Bug description or feature request:

Manual selection of tabs does not works when we use it inside Modals.

I want manual selection of tabs to work in modals

Plunker/StackBlitz that reproduces the issue:

StackBlitz

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap:3.1.3

Angular:6.1.10

Bootstrap:4

Most helpful comment

@hellodpk try this:

  1. add template reference variable to those methods (click)="selectTab(staticTabs, 1)
  2. in component remove @ViewChild and change a bit this method:
selectTab(staticTabs: TabsetComponent, tabId: number) {
    staticTabs.tabs[tabId].active = true;
}

It works for me. I hope does for you too.

All 2 comments

@hellodpk try this:

  1. add template reference variable to those methods (click)="selectTab(staticTabs, 1)
  2. in component remove @ViewChild and change a bit this method:
selectTab(staticTabs: TabsetComponent, tabId: number) {
    staticTabs.tabs[tabId].active = true;
}

It works for me. I hope does for you too.

@MilaLys, above fix worked. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

srjkrl20011991 picture srjkrl20011991  路  3Comments

webdev48 picture webdev48  路  3Comments

ravirajhalli picture ravirajhalli  路  3Comments

hugonne picture hugonne  路  3Comments

ctrl-brk picture ctrl-brk  路  3Comments