title: Ionic 4 preselect a tab in a modal
body: <p>I have a modal that is launched when I click a button</p>
  
  <pre><code>async launchCalculator() {
    const calculator = await this.modalController.create({
      component: CalculatorPage,
      componentProps: {
        dosingType: this.dosingType
      },
      showBackdrop: true,
    });
    return await calculator.present();
  }
  </code></pre>
  
  <p>Inside the modal I have 2 tabs. I am trying to preselect a tab and it is not working.</p>
  
  <pre><code>&lt;ion-header&gt;
    &lt;ion-toolbar&gt;
      &lt;ion-title&gt;Dosing Calculator&lt;/ion-title&gt;
    &lt;/ion-toolbar&gt;
  &lt;/ion-header&gt;
  
  &lt;ion-content padding class="white-bg"&gt;
  
    &lt;ion-tabs &gt;
      &lt;ion-tab tab="standard"&gt;standard content&lt;/ion-tab&gt;
      &lt;ion-tab tab="hepatic"&gt;hepatic Content&lt;/ion-tab&gt;
  
      &lt;ion-tab-bar slot="top" [selectedTab]="dosingType"&gt;
        &lt;ion-tab-button tab="standard"&gt;
          &lt;ion-label&gt;Standard&lt;/ion-label&gt;
        &lt;/ion-tab-button&gt;
        &lt;ion-tab-button tab="hepatic"&gt;
          &lt;ion-label&gt;Hepatic&lt;br&gt;Impairment&lt;/ion-label&gt;
        &lt;/ion-tab-button&gt;
      &lt;/ion-tab-bar&gt;
  
    &lt;/ion-tabs&gt;
  
  &lt;/ion-content&gt;
  </code></pre>
  
  <p>I have set <code>[selectedTab]</code> on the tab-bar and it is not preselecting the tab. If I change the attribute to use:</p>
  
  <pre><code>&lt;ion-tab-bar slot="top" selected-tab="standard"&gt;
  </code></pre>
  
  <p>It sort of works. The tab at least has the selected display state at that point, however, the tab content (should show "standard content") is not visible until I click the tab. Surely I am doing something wrong. Any ideas?</p>
  
  <p><strong><em>Figured it out</em></strong></p>
  
  <p>First <code>&lt;ion-tabs #dosingTabs&gt;</code> add an id. Then in your export <code>@ViewChild('dosingTabs') tabs:Tabs;</code> and then proceed to call <code>this.tabs.select(&lt;name or index&gt;)</code></p>