@@ -1784,7 +1784,7 @@ export function createRouter(init: RouterInit): Router {
1784
1784
) ;
1785
1785
replace = location === state . location . pathname + state . location . search ;
1786
1786
}
1787
- await startRedirectNavigation ( request , result , {
1787
+ await startRedirectNavigation ( request , result , true , {
1788
1788
submission,
1789
1789
replace,
1790
1790
} ) ;
@@ -2037,7 +2037,7 @@ export function createRouter(init: RouterInit): Router {
2037
2037
revalidatingFetchers [ redirect . idx - matchesToLoad . length ] . key ;
2038
2038
fetchRedirectIds . add ( fetcherKey ) ;
2039
2039
}
2040
- await startRedirectNavigation ( request , redirect . result , {
2040
+ await startRedirectNavigation ( request , redirect . result , true , {
2041
2041
replace,
2042
2042
} ) ;
2043
2043
return { shortCircuited : true } ;
@@ -2333,7 +2333,7 @@ export function createRouter(init: RouterInit): Router {
2333
2333
} else {
2334
2334
fetchRedirectIds . add ( key ) ;
2335
2335
updateFetcherState ( key , getLoadingFetcher ( submission ) ) ;
2336
- return startRedirectNavigation ( fetchRequest , actionResult , {
2336
+ return startRedirectNavigation ( fetchRequest , actionResult , false , {
2337
2337
fetcherSubmission : submission ,
2338
2338
} ) ;
2339
2339
}
@@ -2454,7 +2454,11 @@ export function createRouter(init: RouterInit): Router {
2454
2454
revalidatingFetchers [ redirect . idx - matchesToLoad . length ] . key ;
2455
2455
fetchRedirectIds . add ( fetcherKey ) ;
2456
2456
}
2457
- return startRedirectNavigation ( revalidationRequest , redirect . result ) ;
2457
+ return startRedirectNavigation (
2458
+ revalidationRequest ,
2459
+ redirect . result ,
2460
+ false
2461
+ ) ;
2458
2462
}
2459
2463
2460
2464
// Process and commit output from loaders
@@ -2615,7 +2619,7 @@ export function createRouter(init: RouterInit): Router {
2615
2619
return ;
2616
2620
} else {
2617
2621
fetchRedirectIds . add ( key ) ;
2618
- await startRedirectNavigation ( fetchRequest , result ) ;
2622
+ await startRedirectNavigation ( fetchRequest , result , false ) ;
2619
2623
return ;
2620
2624
}
2621
2625
}
@@ -2654,6 +2658,7 @@ export function createRouter(init: RouterInit): Router {
2654
2658
async function startRedirectNavigation (
2655
2659
request : Request ,
2656
2660
redirect : RedirectResult ,
2661
+ isNavigation : boolean ,
2657
2662
{
2658
2663
submission,
2659
2664
fetcherSubmission,
@@ -2740,8 +2745,11 @@ export function createRouter(init: RouterInit): Router {
2740
2745
...activeSubmission ,
2741
2746
formAction : location ,
2742
2747
} ,
2743
- // Preserve this flag across redirects
2748
+ // Preserve these flags across redirects
2744
2749
preventScrollReset : pendingPreventScrollReset ,
2750
+ enableViewTransition : isNavigation
2751
+ ? pendingViewTransitionEnabled
2752
+ : undefined ,
2745
2753
} ) ;
2746
2754
} else {
2747
2755
// If we have a navigation submission, we will preserve it through the
@@ -2754,8 +2762,11 @@ export function createRouter(init: RouterInit): Router {
2754
2762
overrideNavigation,
2755
2763
// Send fetcher submissions through for shouldRevalidate
2756
2764
fetcherSubmission,
2757
- // Preserve this flag across redirects
2765
+ // Preserve these flags across redirects
2758
2766
preventScrollReset : pendingPreventScrollReset ,
2767
+ enableViewTransition : isNavigation
2768
+ ? pendingViewTransitionEnabled
2769
+ : undefined ,
2759
2770
} ) ;
2760
2771
}
2761
2772
}
0 commit comments