You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TanStack Router's defaultViewTransition should respect the Navigation API's NavigateEvent.hasUAVisualTransition property to avoid
conflicting transitions when the browser has already provided one.
Problem
When using defaultViewTransition, TanStack Router always applies a view transition on navigation. However, browsers may now provide their own
visual transitions (e.g., via swipe gestures, browser UI navigation). When both occur, they conflict and create a jarring user experience.
Current Behavior
constrouter=createRouter({defaultViewTransition: {types: ({ fromLocation, toLocation })=>{// This always runs, even if the browser already animated return[`slide-${direction}`];},},});
Expected Behavior
TanStack Router should internally check event.hasUAVisualTransition before calling document.startViewTransition(). If the UA already provided a
transition, skip the custom one:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
TanStack Router's
defaultViewTransitionshould respect the Navigation API'sNavigateEvent.hasUAVisualTransitionproperty to avoidconflicting transitions when the browser has already provided one.
Problem
When using
defaultViewTransition, TanStack Router always applies a view transition on navigation. However, browsers may now provide their ownvisual transitions (e.g., via swipe gestures, browser UI navigation). When both occur, they conflict and create a jarring user experience.
Current Behavior
Expected Behavior
TanStack Router should internally check event.hasUAVisualTransition before calling document.startViewTransition(). If the UA already provided a
transition, skip the custom one:
References
Beta Was this translation helpful? Give feedback.
All reactions