-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Which project does this relate to?
Router
Describe the bug
When navigating through browser history manually using the Tanstack Router BrowserHistory API, native browser transitions (from the new View Transitions API) are not happening. They do occur when using the native window.history API.
Example use case would be a "Back" button that navigates the user back in history.
Your Example Website or App
https://stackblitz.com/edit/github-axehctcy
Steps to Reproduce the Bug or Issue
- Load the example app on the "Home" page
- Navigate to the "About" page (note the browser default fade transition)
- Click the "Back to Previous Page with router.history.back()" button text
- Navigation will have no transition
Expected behavior
Navigation should use the same transition that navigating back with the window.history.back() or native browser back button uses. Notice the other button in the example does transition.
Screenshots or Videos
No response
Platform
- OS: Mac OS
- Browser: Chrome
- Version: 131.0.6778.109
Additional context
The notify() call in the browser history source appears to override or cancel out the default transition animation. Is it possible that we do not need to call browser history subscribers in some history events, since native browser events like the user clicking the back button do not do so either?