Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationTransition.from.key is the same as NavigationDestination.key #31

Open
2 tasks done
absurdprofit opened this issue Apr 28, 2024 · 2 comments
Open
2 tasks done

Comments

@absurdprofit
Copy link

absurdprofit commented Apr 28, 2024

Prerequisites

  • I have written a descriptive issue title
  • 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

  1. Apply the polyfill using the applyPolyfill function with history, interceptEvents, patch, persist and persistState config options set to true.
  2. Attach an event listener to window.navigation for navigation events.
  3. 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.

@fabiancook
Copy link
Contributor

fabiancook commented Apr 28, 2024

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.

@absurdprofit
Copy link
Author

absurdprofit commented Apr 28, 2024

Sure, here's the example. Navigate to any route and an assertion is thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants