From 64f319903ab3b00d060b24b34fe79378356469a8 Mon Sep 17 00:00:00 2001 From: Sean Perkins <13732623+sean-perkins@users.noreply.github.com> Date: Thu, 31 Aug 2023 21:56:38 -0400 Subject: [PATCH] fix(vue): router replace action uses custom animation --- packages/vue-router/src/router.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/vue-router/src/router.ts b/packages/vue-router/src/router.ts index 35ce3d55a9..a1ef4728b3 100644 --- a/packages/vue-router/src/router.ts +++ b/packages/vue-router/src/router.ts @@ -400,6 +400,8 @@ export const createIonRouter = ( currentHistoryPosition ); + const routerAnimation = incomingRouteParams.routerAnimation || currentRouteInfo?.routerAnimation || routeInfo.routerAnimation; + /** * If going from /home to /child, then replacing from * /child to /home, we don't want the route info to @@ -417,8 +419,7 @@ export const createIonRouter = ( routeInfo.pushedByRoute = pushedByRoute; routeInfo.routerDirection = currentRouteInfo?.routerDirection || routeInfo.routerDirection; - routeInfo.routerAnimation = - currentRouteInfo?.routerAnimation || routeInfo.routerAnimation; + routeInfo.routerAnimation = routerAnimation; routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname; } }