mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(react, vue): navigating using ion-back-button now selects correct page (#22974)
resolves #22830
This commit is contained in:
@ -241,7 +241,7 @@ class IonRouterInner extends React.PureComponent<IonRouteProps, IonRouteState> {
|
||||
routeDirection: 'back',
|
||||
routeAnimation: routeAnimation || routeInfo.routeAnimation,
|
||||
};
|
||||
if (routeInfo.lastPathname === routeInfo.pushedByRoute) {
|
||||
if (routeInfo.lastPathname === routeInfo.pushedByRoute || prevInfo.pathname === routeInfo.pushedByRoute) {
|
||||
this.props.history.goBack();
|
||||
} else {
|
||||
this.handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back');
|
||||
|
@ -88,7 +88,7 @@ export const createIonRouter = (opts: IonicVueRouterOptions, router: Router) =>
|
||||
const prevInfo = locationHistory.findLastLocation(routeInfo);
|
||||
if (prevInfo) {
|
||||
incomingRouteParams = { ...prevInfo, routerAction: 'pop', routerDirection: 'back', routerAnimation: routerAnimation || routeInfo.routerAnimation };
|
||||
if (routeInfo.lastPathname === routeInfo.pushedByRoute) {
|
||||
if (routeInfo.lastPathname === routeInfo.pushedByRoute || prevInfo.pathname === routeInfo.pushedByRoute) {
|
||||
router.back();
|
||||
} else {
|
||||
router.replace({ path: prevInfo.pathname, query: parseQuery(prevInfo.search) });
|
||||
|
Reference in New Issue
Block a user