chore(react): fixing test and another method to tab nav

This commit is contained in:
Ely Lucas
2019-10-14 08:43:39 -06:00
committed by GitHub
parent 87765564f6
commit 81b1072322
4 changed files with 11 additions and 4 deletions

View File

@ -10,7 +10,7 @@ describe('IonTabs', () => {
const { container } = render(
<IonTabs>
<IonRouterOutlet></IonRouterOutlet>
<IonTabBar slot="bottom" currentPath={'/'} navigate={() => {}}>
<IonTabBar slot="bottom" currentPath={'/'}>
<IonTabButton tab="schedule">
<IonLabel>Schedule</IonLabel>
<IonIcon name="schedule"></IonIcon>
@ -44,7 +44,7 @@ describe('IonTabs', () => {
const { container } = render(
<IonTabs>
<IonRouterOutlet></IonRouterOutlet>
<IonTabBar slot="bottom" currentPath={'/'} navigate={() => {}}>
<IonTabBar slot="bottom" currentPath={'/'}>
{false &&
<IonTabButton tab="schedule">
<IonLabel>Schedule</IonLabel>

View File

@ -70,7 +70,7 @@ const IonTabBarUnwrapped = /*@__PURE__*/(() => class extends React.Component<Pro
if (this.state.activeTab === e.detail.tab) {
const originalHref = this.state.tabs[e.detail.tab].originalHref;
if (this.context.hasIonicRouter()) {
this.context.goBack(originalHref);
this.context.tabNavigate(originalHref);
} else {
this.context.navigate(originalHref, 'back');
}