Skip to content

fix(vue): routing history is correctly replaced when overwriting browser history - #24670

Merged
liamdebeasi merged 19 commits into
mainfrom
FW-171
Feb 2, 2022
Merged

liamdebeasi merged 19 commits into
mainfrom
FW-171

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented Jan 27, 2022 •

Copy link
Copy Markdown
Contributor

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 January 27, 2022 21:37
@github-actions github-actions Bot added the package: vue @ionic/vue package label Jan 27, 2022
@liamdebeasi

Copy link
Copy Markdown
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
Copy Markdown
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