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

Suspense component kills reactive changes #2214

Closed
gokhantaskan opened this issue Sep 23, 2020 · 6 comments
Closed

Suspense component kills reactive changes #2214

gokhantaskan opened this issue Sep 23, 2020 · 6 comments
Labels
🐞 bug Something isn't working scope: suspense

Comments

@gokhantaskan
Copy link

gokhantaskan commented Sep 23, 2020

Version

3.0.0

Reproduction link

https://codesandbox.io/s/vuenext-v300-suspense-reactivity-qglxd

Steps to reproduce

There is a really simple form with just two inputs. When you change the input data in the sandbox, you will see that the form state won't change between Suspense tags.

If the repo is not opening, please use the refresh button on top left of the sandbox browser.

What is expected?

The code tag under the Suspense component should be reactive.

What is actually happening?

The reactive text is not changing.

@posva posva added 🐞 bug Something isn't working scope: suspense labels Sep 23, 2020
@meteorlxy
Copy link
Member

meteorlxy commented Sep 24, 2020

Tried to make a minimal repro link:

https://codepen.io/meteorlxy/pen/QWNYKwe

If the slots of <Suspense> have ANY child-elements (including comments), the bug occurred.

That happens in both #default and #fallback slots.

@gokhantaskan
Copy link
Author

Tried to make a minimal repro link:

https://codepen.io/meteorlxy/pen/QWNYKwe

If the slots of <Suspense> have ANY child-elements (including comments), the bug occurred.

That happens in both #default and #fallback slots.

The code below is not responding:

<template #default>
    <div>
        <span>{{ msg }}</span>
    </div>
</template>

This code is reactive:

<template #default>
    <div>
        {{ msg }}
    </div>
</template>

It seems that there is a bug related to the watch/deep or something like that.

@meteorlxy
Copy link
Member

Made another repro link: https://codesandbox.io/s/vuenext-v300-suspense-reactivity-forked-1v92v?file=/src/index.js

  • openBlock() + createBlock(): BUG
  • createVNode(): OK
  • h(): OK

@edison1105
Copy link
Member

edison1105 commented Oct 9, 2020

It's not relate to reactive.
This bug is caused by the patchFlag of VNode is 0.
There is nothing to do in patchElement function when input value changed.
Maybe it's bad way to fix this, but works fine.😭😭😭

@softboy99
Copy link

Hi
it seems that problems still exists for reactive array

@edison1105
Copy link
Member

@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: suspense
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants