-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: ionic vue navigating to the same page with a different parameter should still result in a transition #22662
Comments
+1 |
On top of the details I added in #22931, I'm also finding that the component This is to say that components that remain mounted for ease of state management (according to Ionics docs) are susceptible to their base data changing, and in my case, this causes errors as the component relies on route metadata that is incorrectly changed. Note in this screenshot (details of this example in #22931) that the main I hope this adds some more context to the bug, as before I assume this is related and will continue to add any nuances I discover. |
Does anyone know of a workaround for this? I am having the issue mentioned in #22931 where I am navigating to the same route with different parameters but the content doesn't change (the URL does). |
Depending if you want a page transition or not (this example won't), we had to watch for changes of the route parameters along the lines of this... const route = useRoute();
let id = route.params.id
watchEffect(() => {
if (route.params.id != id) {
// trigger page refresh/trigger payload refresh
}
}); (i don't have access to my actual code at the moment, but that was roughly the gist of it) |
Awesome, thanks! Your code sparked a solution for me. I had already converted <ion-button @click="navigateToLesson(trackId, previousLessonId)">Previous</ion-button>
<ion-button @click="navigateToLesson(trackId, nextLessonId)">Next</ion-button> async navigateToLesson(trackId: number, lessonId: number): Promise<void> {
await this.$router.push({
name: 'tabs.training.study.lesson',
params: { trackId: trackId, lessonId: lessonId },
})
this.trackId = parseInt(this.$route.params.trackId.toString())
this.lessonId = parseInt(this.$route.params.lessonId.toString())
} |
I've been using the |
@liamdebeasi I don't want to be one of those people, but I was wondering if there is any progress on this issue. Seems like very common use case, and one that we come up against again and again. Thanks |
I do not have an update, but I have added to our v6 milestone. |
Thanks, i had a stab at making a fix this morning, but it got the point where I had to start cloning pages and I quickly got out of my depth. Will keep an eye out for the fix 👍 |
Hi everyone, I have a fix for this in #23525 and will likely merge the PR tomorrow. I have included a dev build below for anyone who would like to test. Please note that this is a Framework v6 dev build and is subject to the breaking changes noted in https://github.com/ionic-team/ionic-framework/blob/next/BREAKING.md#version-6x. This fix depends on a change made in Ionic Vue v6 and cannot be easily backported to v5, so this is going to be a v6-only fix.
|
Thanks for the issue. This has been resolved via #23525, and a fix will be available in an upcoming release of the Ionic Framework v6 beta. |
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. |
Bug Report
Ionic version:
[ ] 4.x
[x] 5.x
Current behavior:
Given a route of
/page/:id
, going from/page/1
topage/2
does not result in a nav transition. The new page content simply appears.Expected behavior:
I would expect that there is a nav transition.
Related code:
We need to implement the following logic in Ionic Vue, similar to how Ionic React does it:
ionic-framework/packages/react-router/src/ReactRouter/StackManager.tsx
Lines 166 to 175 in 91aaaab
Other information:
See: #22658 (comment) and #22658 (comment)
The text was updated successfully, but these errors were encountered: