Skip to content

Commit c8be8e2

Browse files
committed
fix(tabs): emit viewDidEnter and viewDidLeave on app during tab change
1 parent c4e9b5d commit c8be8e2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/tabs/tabs.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,15 @@ export class Tabs extends Ion implements AfterViewInit, RootNode, ITabs, Navigat
452452
}
453453

454454
// Fire didEnter/didLeave lifecycle events
455-
selectedPage && selectedPage._didEnter();
456-
currentPage && currentPage._didLeave();
455+
if (selectedPage) {
456+
selectedPage._didEnter();
457+
this._app.viewDidEnter.emit(selectedPage);
458+
}
459+
460+
if (currentPage) {
461+
currentPage && currentPage._didLeave();
462+
this._app.viewDidLeave.emit(currentPage);
463+
}
457464

458465
// track the order of which tabs have been selected, by their index
459466
// do not track if the tab index is the same as the previous

0 commit comments

Comments
 (0)