mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
fix(react, vue): correct view now chosen when going back inside tabs (#23154)
resolves #23087 resolves #23101
This commit is contained in:
@ -88,7 +88,19 @@ 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 || prevInfo.pathname === routeInfo.pushedByRoute) {
|
||||
if (
|
||||
routeInfo.lastPathname === routeInfo.pushedByRoute ||
|
||||
(
|
||||
/**
|
||||
* We need to exclude tab switches/tab
|
||||
* context changes here because tabbed
|
||||
* navigation is not linear, but router.back()
|
||||
* will go back in a linear fashion.
|
||||
*/
|
||||
prevInfo.pathname === routeInfo.pushedByRoute &&
|
||||
routeInfo.tab === '' && prevInfo.tab === ''
|
||||
)
|
||||
) {
|
||||
router.back();
|
||||
} else {
|
||||
router.replace({ path: prevInfo.pathname, query: parseQuery(prevInfo.search) });
|
||||
|
Reference in New Issue
Block a user