From c8be8e254cb0bc90c956323b6ff53fb23093cc00 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 10 Oct 2017 10:49:58 -0500 Subject: [PATCH] fix(tabs): emit viewDidEnter and viewDidLeave on app during tab change --- src/components/tabs/tabs.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 095b4f0f8ad..3e0d967ace2 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -452,8 +452,15 @@ export class Tabs extends Ion implements AfterViewInit, RootNode, ITabs, Navigat } // Fire didEnter/didLeave lifecycle events - selectedPage && selectedPage._didEnter(); - currentPage && currentPage._didLeave(); + if (selectedPage) { + selectedPage._didEnter(); + this._app.viewDidEnter.emit(selectedPage); + } + + if (currentPage) { + currentPage && currentPage._didLeave(); + this._app.viewDidLeave.emit(currentPage); + } // track the order of which tabs have been selected, by their index // do not track if the tab index is the same as the previous