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: Navigating between instances of the same route with different parameters does not show updated content #22931

Closed
beneverard opened this issue Feb 16, 2021 · 5 comments

Comments

@beneverard
Copy link

Bug Report

Ionic version:
[ ] 4.x
[x] 5.x

Current behavior:
Navigating between instances of the same route with different parameters does not create a new version of the component, and thus does not show the correct data for the route.

Expected behavior:
When navigating between the same route with different parameter, a new component should be spawned with its own state, allowing navigation back to the previous and separate instance.

Steps to reproduce:

  1. Go to bug test example
  2. Go to the 1st message
  3. Click blue "Go To Message 5" button
  4. URL updates, but the component key/content does not change

(Note, I didn't setup Netlify redirects, so visit the root URL and navigate from within the app)

Related code:
This is the ion-button code, the only change made from the Vue sample:

<ion-button router-link="/message/5" routerDirection="forward" :detail="false" class="list-item">Go To Message 5</ion-button>

Other information:
This bug report says how components stay mounted in order to allow the state to be kept the same when navigating back through the history, but in this case the component is staying mounted and retains the original message data (index 0), instead of the new message data (index 5).

#20543

This makes sense but causes a problem in this situation.

Ionic info:

$ ionic info

Ionic:

   Ionic CLI       : 6.12.4 (/Users/beneverard/.config/yarn/global/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 5.5.4

Capacitor:

   Capacitor CLI   : 2.4.6
   @capacitor/core : 2.4.6

Utility:

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

System:

   NodeJS : v15.7.0 (/usr/local/bin/node)
   npm    : 7.4.3
   OS     : macOS Catalina
@beneverard beneverard changed the title bug: bug: Navigating between instances of the same route with different parameters does not show udpated content Feb 16, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. I am going to close this as a duplicate of #22662.

@beneverard
Copy link
Author

Hi @liamdebeasi, thanks, I did see this after I just posted. I just want to check, in your bug report you say "The new page content simply appears.", whereas what I'm reporting here is that the new content doesn't display at all.

Just want to make sure you're aware, they very well may be covering the same issue.

@liamdebeasi
Copy link
Contributor

Thanks for clarifying! Yeah I think the two issues are related.

@beneverard
Copy link
Author

Thanks again Liam :-)

@beneverard beneverard changed the title bug: Navigating between instances of the same route with different parameters does not show udpated content bug: Navigating between instances of the same route with different parameters does not show updated content Feb 19, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Mar 21, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants