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

Nested child routes and using <suspense> #10042

Open
719media opened this issue Jan 9, 2024 · 2 comments · May be fixed by #10066
Open

Nested child routes and using <suspense> #10042

719media opened this issue Jan 9, 2024 · 2 comments · May be fixed by #10066
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: suspense

Comments

@719media
Copy link

719media commented Jan 9, 2024

Vue version

3.4.6, probably all of 3.x

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-jjvegj?file=src%2FApp.vue,src%2Fpages%2Fdemo.vue

Steps to reproduce

https://stackblitz.com/edit/vitejs-vite-jjvegj?file=src%2FApp.vue,src%2Fpages%2Fdemo.vue
Click on "link demo nested", note that the child "demo.vue" route renders after a timeout. Then navigate away. Note that the "child" router-view gets unmounted. Ideally, this should not happen.

This stackblitz is forked from discussion here:
https://stackoverflow.com/questions/76185240/suspense-in-vue-3-on-nested-routes-why-content-disappears
and here:
vuejs/router#1833

For my uses (router-view keeping the previous page until the new component async setup is complete) this would be ideal default behavior.

Suggested workaround from the stackoverflow article, which is done here (just changes to the demo.vue file): https://stackblitz.com/edit/vitejs-vite-e1br9h?file=src%2FApp.vue,src%2Fpages%2Fdemo.vue

Does indeed "work"

What is expected?

The child route does not unmount until the suspense has finished

What is actually happening?

The child route unmounts immediately

System Info

No response

Any additional comments?

No response

@719media 719media changed the title Nexted child routes and using <suspense> Nested child routes and using <suspense> Jan 9, 2024
@yyx990803 yyx990803 added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Jan 11, 2024
edison1105 added a commit to edison1105/vuejs-core that referenced this issue Feb 6, 2024
edison1105 added a commit to edison1105/vuejs-core that referenced this issue Mar 8, 2024
@719media
Copy link
Author

Anything I can do to test/help get this moving?

@edison1105
Copy link
Member

@719media
there may be a chance to fix it in v3.5, probably be in early April.

yyx990803 added a commit to edison1105/vuejs-core that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: suspense
Projects
None yet
3 participants