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

bug: ion-router-outlet does not show correct page after vue-router navigation guard was used #29721

Open
3 tasks done
martinclaus1 opened this issue Jul 18, 2024 · 3 comments · May be fixed by #29769
Open
3 tasks done
Labels

Comments

@martinclaus1
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

The ion-router-outlet shows the wrong page after a vue-router navigation guard was used.

Given:

  • ion-page Home
  • ion-page Register
  • ion-page Profile

When:
A user registers using the following flow: Home -> Register -> Profile.
The transition from Home -> Register uses router.push.
The transition from Register -> Profile uses router.replace.
Being on the Profile page, back navigation is prevented using a navigation guard (see example).

Then:
After a logout (Profile -> Home), it's not possible to log in again (Home -> Profile) because the ion-router-outlet shows the wrong page although the path was changed to /profile.

image

Expected Behavior

The correct ion-page should be displayed after a navigation guard prevented the user from going back.
image
The Profile page should be displayed.

Steps to Reproduce

  1. go to Home page
  2. click on "REGISTER"
  3. click on "SIGN UP"
  4. try to go one step back in history, e.g. by using the back button on the mouse
  5. see that the page does not change [EXPECTED]
  6. click on "LOGOUT"
  7. click on "LOGIN"
  8. see that page does not change [BUG]

Code Reproduction URL

https://stackblitz.com/edit/vitejs-vite-vphseq?file=README.md

Ionic Info

Ionic:

Ionic CLI : 7.2.0
Ionic Framework : @ionic/vue 8.2.5

Capacitor:

Capacitor CLI : 6.1.0
@capacitor/android : 6.1.1
@capacitor/core : 6.1.0
@capacitor/ios : 6.1.1

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.12.0
npm : 10.8.1
OS : macOS Unknown

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jul 18, 2024
@NRodriguezcuellar
Copy link

I am experiencing a similar problem when signing in and and signing out using tabs. When i sign back in from just signing out, the logout tab is shown instead of the the dashboard tab (which does correctly show in the url and also loads the data correctly). I am also using navigation guards so this might involve this problem.

@gzqby gzqby linked a pull request Aug 13, 2024 that will close this issue
2 tasks
@MervinDelfin
Copy link

issue still present

@MervinDelfin
Copy link

#29769 does not fix it for me

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 a pull request may close this issue.

3 participants