navigation
navigation copied to clipboard
NavigationTransition.from.key is the same as NavigationDestination.key
Prerequisites
- [X] I have written a descriptive issue title
- [x] I have searched existing issues to ensure it has not already been reported
Version (i.e. v2.x.x)
1.0.1-alpha.202
Node.js version (i.e. 18.x, or N/A)
No response
Operating system
N/A
Operating system version (i.e. 20.04, 11.3, 10, or N/A)
N/A
Description
During a NavigateEvent interception the NavigationTransition.from on the navigation object has the same key as NavigationDestination on the NavigateEvent object. The key doesn't seem to be an existing history entry key. I've been using the API in chromium for a while now and built my router around that so I'm decently certain this is a bug.
Steps to Reproduce
- Apply the polyfill using the applyPolyfill function with history, interceptEvents, patch, persist and persistState config options set to true.
- Attach an event listener to window.navigation for navigation events.
- Observe the key on navigation.transition.from and event.destination.
Expected Behavior
When NavigateEvent.navigationType is push the key should be empty. When NavigateEvent.navigationType is traverse, replace or reload the key should be an existing history entry key.
Would it be possible to reproduce this as an example by chance?
e.g. https://github.com/virtualstate/navigation/blob/main/example/webcomponents.html
It can include assertions as to what should be expected.
Sure, here's the example. Navigate to any route and an assertion is thrown.