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(vue): routing history is correctly replaced when overwriting browser history #24670

Merged
merged 19 commits into from
Feb 2, 2022

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Jan 27, 2022

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: resolves #23873

What is the new behavior?

  • After going "back" to a new route that previously never existed, Ionic Vue will clear the future location history as it is no longer relevant.
  • When pushing new history after going back, Ionic Vue now clears out future location history items as they are no longer relevant. This also applies when setting the "root" route (I.e. routerDirection="root") as the first item in the location history array is being replaced. As a result, everything after that is no longer relevant.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@liamdebeasi liamdebeasi requested a review from a team as a code owner January 27, 2022 21:37
@github-actions github-actions bot added the package: vue @ionic/vue package label Jan 27, 2022
@liamdebeasi
Copy link
Contributor Author

I found another instance where we need to clear the location history. I am working on cleaning up this code + testing and will request another review when I am done.

@liamdebeasi
Copy link
Contributor Author

I fixed the remaining issues and wrote tests. Need to clean up the code since there is a lot of duplicate lines. I will request reviews once that is done.

@liamdebeasi liamdebeasi changed the title fix(vue): using IonBackButton to go to a defaultHref route now modifies stack history correctly fix(vue): routing history is correctly replaced when overwriting browser history Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: routing breaks after specific sequence of navigations and clicking on ion-back-button
3 participants