mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 09:34:19 +08:00
@ -88,7 +88,7 @@ class RouteManager extends React.Component<RouteComponentProps, RouteManagerStat
|
||||
}
|
||||
|
||||
historyChange(location: HistoryLocation, action: HistoryAction) {
|
||||
const ionRouteAction = this.currentIonRouteAction === 'pop' ? 'pop' : action.toLowerCase();
|
||||
const ionRouteAction = this.currentIonRouteAction === 'pop' ? 'pop' : action.toLowerCase() as IonRouteAction;
|
||||
let direction = this.currentRouteDirection;
|
||||
|
||||
if (ionRouteAction === 'push') {
|
||||
@ -101,6 +101,11 @@ class RouteManager extends React.Component<RouteComponentProps, RouteManagerStat
|
||||
direction = 'none';
|
||||
}
|
||||
|
||||
if (direction === 'root') {
|
||||
this.locationHistory.clear();
|
||||
this.locationHistory.add(location);
|
||||
}
|
||||
|
||||
location.state = location.state || { direction };
|
||||
this.setState({
|
||||
location,
|
||||
@ -175,8 +180,15 @@ class RouteManager extends React.Component<RouteComponentProps, RouteManagerStat
|
||||
const enteringEl = this.ionPageElements[enteringView.id];
|
||||
const leavingEl = leavingView && this.ionPageElements[leavingView.id];
|
||||
if (enteringEl) {
|
||||
// Don't animate from an empty view
|
||||
const navDirection = leavingEl && leavingEl.innerHTML === '' ? undefined : direction === 'none' ? undefined : direction;
|
||||
let navDirection: NavDirection | undefined;
|
||||
if (leavingEl && leavingEl.innerHTML === '') {
|
||||
// Don't animate from an empty view
|
||||
navDirection = undefined;
|
||||
} else if (direction === 'none' || direction === 'root') {
|
||||
navDirection = undefined;
|
||||
} else {
|
||||
navDirection = direction;
|
||||
}
|
||||
const shouldGoBack = !!enteringView.prevId;
|
||||
const routerOutlet = this.routerOutlets[viewStack.id];
|
||||
this.commitView(
|
||||
|
Reference in New Issue
Block a user