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

v-model + filter issue #486

Closed
fullfs opened this issue Oct 14, 2014 · 1 comment
Closed

v-model + filter issue #486

fullfs opened this issue Oct 14, 2014 · 1 comment

Comments

@fullfs
Copy link

fullfs commented Oct 14, 2014

Hello!
When using v-model on input (for example) along with a filter there is lag between input value and vm data value.

You can see it on example (try typing some numbers into input):
http://jsfiddle.net/alekzonder/tw22zu3z/3/
If value is modified by the filter, there is always a lag.

Had to add something like that to fix the problem:
http://jsfiddle.net/tw22zu3z/55/

Don't know if it's a bug or a feature, but I would like to get some easy method to sync those values.

yyx990803 added a commit that referenced this issue Oct 14, 2014
@yyx990803
Copy link
Member

This is actually caused by the way v-model restores the cursor position after updating the <input>'s value. I've adjusted the restoring algorithm to work in your example, because it seems to be the more common use case.

Another thing is you should be using a write filter instead of a read one.

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

No branches or pull requests

2 participants