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

reactivity issue with property watch and emit #2200

Closed
prigaux opened this issue Sep 22, 2020 · 4 comments · Fixed by #2213
Closed

reactivity issue with property watch and emit #2200

prigaux opened this issue Sep 22, 2020 · 4 comments · Fixed by #2213
Labels
has PR A pull request has already been submitted to solve the issue 🐞 bug Something isn't working

Comments

@prigaux
Copy link

prigaux commented Sep 22, 2020

Version

3.0.0

Reproduction link

https://jsfiddle.net/unz2ga94/

Steps to reproduce

On the minimal reproduction example, click on "via watch on component property"

What is expected?

it should display "global: indirectVal"

What is actually happening?

it displays "global: initialValue"


On the minimal reproduction example, you can replace https://unpkg.com/vue@next with https://unpkg.com/vue@2.x to show the behaviour with Vue.js 2.x

Is this an expected regression? (I've read various migration stuff and didn't find any mention of this).

In the project that hit this issue, the component is doing stuff with textarea cursor: component code

@LinusBorg LinusBorg added the 🐞 bug Something isn't working label Sep 22, 2020
@LinusBorg
Copy link
Member

The data for "description" is correctly updated and the component even-re-renders - seems rather to be a bug in a vdom optimization? but then why do the other approaches correctly update the DOM?

Weird. renderTriggered is called for "description" as would be expected, but renderTracked isn't ...?

@posva
Copy link
Member

posva commented Sep 22, 2020

This probably related to recent changes in the watch mechanism defaults. Using flush: 'post' fixes the problem:

      watch: {
        setit: {
          handler: 'tellParent',
          flush: 'post'
        }
      },

It's in the changelog

@posva posva closed this as completed Sep 22, 2020
@LinusBorg
Copy link
Member

LinusBorg commented Sep 22, 2020

But then the question remains why do we need to choose flush: post here, while Vue 2 - as explained in the linked changelog issue - is flush: pre and it works as it is in Vue 2 whereas in Vue 3, we now have to choose flush post? It doesn't seem like an intentional behaviour to me.

And if this is indeed a new behavior in Vue 3, then we need to properly document it.

@posva posva reopened this Sep 22, 2020
@skirtles-code
Copy link
Contributor

This looks like a re-occurrence of #1801.

If you explicitly set flush: 'pre' (so that the change in default value is not a factor) it works fine up until rc.11. It stopped working in rc.12.

@posva posva added the has PR A pull request has already been submitted to solve the issue label Sep 29, 2020
yyx990803 pushed a commit that referenced this issue Oct 5, 2020
So that the scheduler also respects effect's allowRecurse option.

fix #2200
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has PR A pull request has already been submitted to solve the issue 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants