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

@input.once preventing the update of the input if used with v-model #6552

Closed
mcmillenb opened this issue Sep 8, 2017 · 2 comments
Closed
Labels

Comments

@mcmillenb
Copy link
Contributor

mcmillenb commented Sep 8, 2017

Version

2.4.2

Reproduction link

https://jsfiddle.net/vwtLfh2e/1/

Steps to reproduce

Type one character in the input

What is expected?

The character is added to the input, the value property is updated to reflect the change, and the setDirty method is called, setting isDirty to true

What is actually happening?

The setDirty method is called, but nothing is added to the input and the value does not update.


After the first character entry into the input, the model binding works as expected. It seems that using @input.once="someMethod" is preventing the expected behavior of v-model.

Found via this StackOverflow question

@posva posva added the bug label Sep 8, 2017
@posva posva changed the title v-model with @input.once not updating as expected @input.once preventing the update of the input if used with v-model Sep 8, 2017
@Kingwl
Copy link
Member

Kingwl commented Sep 11, 2017

the passive & capture modifier has this problem too

@Kingwl
Copy link
Member

Kingwl commented Sep 11, 2017

seems the fst callback ( input.once event handler ) modified the data and push a microtask (update) to the queue
the update task is execute before the 2nd callback (input event handler) and refresh the dom props sync
and the 2nd callback ( input event handler ) get the dom props (value) updated
and i have no idea to fix that🌚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants