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

Fix duplicated push history #480

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

Legend-Master
Copy link
Contributor

@Legend-Master Legend-Master commented Sep 21, 2024

Fix #479

From debugging, it seems that we are changing the state to undefined here, while the state set from click events from anchor tags are from getAttribute which uses null, so the states are always different

const state = window.history.state && window.history.state._depth && Object.keys(window.history.state).length === 1 ? undefined : window.history.state;
return {
value: url + window.location.hash,
state
}

Copy link

changeset-bot bot commented Sep 21, 2024

🦋 Changeset detected

Latest commit: 0a964b6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ryansolid ryansolid merged commit 626c224 into solidjs:main Sep 23, 2024
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

Successfully merging this pull request may close these issues.

Duplicated history push when navigating back and forward and then clicking on a link
2 participants