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

change hash without affecting the rest of URL #9960

Merged
merged 3 commits into from
Sep 1, 2020
Merged

Conversation

raegen
Copy link
Contributor

@raegen raegen commented Aug 28, 2020

Closes #9955 . Hash change currently replaces history state url with only the updated hash, ignoring the current URL (path, query parameters etc). This PR fixes the hash change strategy, so that it updates only the fragment (part in case of a named fragment parameter), while leaving the rest of URL untouched.

Launch Checklist

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix the hash control conflicting with external history state manipulation</changelog>

Closes mapbox#9955 . Hash change currently replaces history state url with only the updated hash, ignoring the current URL (path, query parameters etc). This PR fixes the hash change method, so that it updates only the fragment (part in case of a named fragment parameter), while leaving the rest of URL untouched.
Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why CI didn't run on the initial commit, but after bumping it, I see a ton of unit test failures — can you look at fixing those?

@raegen
Copy link
Contributor Author

raegen commented Sep 1, 2020

On it

null will default to document.title
@raegen
Copy link
Contributor Author

raegen commented Sep 1, 2020

@mourner there you go :)

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@mourner mourner merged commit eb64a62 into mapbox:main Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hash replacing whole path
2 participants