From edbcf9f8344d136cbfe7935e5baf842544b2167c Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sat, 27 Jun 2015 14:04:12 -0500 Subject: [PATCH] fix back btn when switching tabs --- ionic/components/tabs/tab.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ionic/components/tabs/tab.js b/ionic/components/tabs/tab.js index 9db9e81c25..19fbbafd0b 100644 --- a/ionic/components/tabs/tab.js +++ b/ionic/components/tabs/tab.js @@ -59,6 +59,13 @@ export class Tab extends ViewController { return activeItem && activeItem.navbarView(); }; + item.enableBack = () => { + // override ViewItem's enableBack(), should use the + // active child nav item's enableBack() instead + let activeItem = this.getActive(); + return (activeItem && activeItem.enableBack()); + }; + this.panelId = 'tab-panel-' + item.id; this.labeledBy = 'tab-button-' + item.id; }