Skip to content

KeepAlive Dynamic Include Not Restoring State Properly #5747

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

Closed
incutonez opened this issue Apr 18, 2022 · 8 comments
Closed

KeepAlive Dynamic Include Not Restoring State Properly #5747

incutonez opened this issue Apr 18, 2022 · 8 comments
Labels
has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: keep-alive

Comments

@incutonez
Copy link

incutonez commented Apr 18, 2022

Version

3.2.33

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  • Click the Set Show button in Component 1
  • Verify Thing! shows
  • Click Toggle button
  • Verify Component 2 shows
  • Click Toggle button
  • Verify Component1 with Thing! shows
  • Click Set Show button
  • Verify Thing! does not hide

What is expected?

When I click Set Show after performing the above steps, it should hide Thing! from being shown.

What is actually happening?

Set Show is triggered, but the values do not appear to be respected anymore, as Thing! never goes away no matter how many times Set Show is clicked.

@liulinboyi
Copy link
Member

liulinboyi commented Apr 19, 2022

In this case the case will be fine.
Write it like this and you'll be fine

In yuor case, i debugger the code find the ComponentOne's dep is disapper.

163940570-643ae1f8-5234-4bda-8f38-ba01a65c25ce

This may be a bug.

@posva
Copy link
Member

posva commented Apr 19, 2022

Seems related to #4984 but not sure if it's a duplicate.

As a workaround use a ref for the array and replace the whole array instead of pushing:

activeDialogs.value = activeDialogs.value.concat(name)

@posva posva added 🐞 bug Something isn't working scope: keep-alive has workaround A workaround has been found to avoid the problem labels Apr 19, 2022
@liulinboyi
Copy link
Member

liulinboyi commented Apr 19, 2022

@incutonez This case will be fine ☺️.

@incutonez
Copy link
Author

Wonderful, thank y'all for the quick responses and workaround!

@edison1105
Copy link
Member

duplicate of #4984

@liulinboyi
Copy link
Member

liulinboyi commented May 12, 2022

This issue is fixed by commit.

@posva
Copy link
Member

posva commented Jul 19, 2022

This one seems to still be broken

@edison1105
Copy link
Member

Closing as it can not reproduce anymore. see playground

@edison1105 edison1105 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: keep-alive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants