-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tabs): emit viewDidEnter and viewDidLeave on app during tab change
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
manucorporat
Contributor
|
||
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 | ||
|
@mlynch no need to have:
since we know for sure
currentPage
is non-null inside the if statement