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

Ignoring the .lazy modifier #26

Open
cristian-frumusanu opened this issue Feb 11, 2019 · 9 comments
Open

Ignoring the .lazy modifier #26

cristian-frumusanu opened this issue Feb 11, 2019 · 9 comments

Comments

@cristian-frumusanu
Copy link

Hello.
Thanks for the great component!

I have identified one issue, though.

When using the .lazy modifier on v-model, the AutoNumeric component updates the model on the input event, rather than on the change event.

I have created a fiddle to illustrate the issue in which there is a standard input next to a Vue AutoNumeric component: https://jsfiddle.net/p462eLa9/1/

Please let me know your thoughts on this.

@AlexandreBonneau
Copy link
Member

You are correct, I totally overlooked that modifier!

@cristian-frumusanu
Copy link
Author

@AlexandreBonneau
I'm glad I could help.
Are you planning to release an update in the near future that would include the fix to this issue?
Thanks.

@AlexandreBonneau
Copy link
Member

Yes, but it depends on your definition of 'near future' really :)
I'm pretty swamped for a few months now, so I'll see when I can get a closer look into that issue.

If you find the solution on your end, please feel free to create a PR!

@cristian-frumusanu
Copy link
Author

@AlexandreBonneau

I've done some digging around and I don't think it's possible without this:
vuejs/vue#6914

@doucouredave
Copy link

Same issue.
@AlexandreBonneau, have you planned to fix the issue?
@cristian-frumusanu , have you get a workaround?

@cristian-frumusanu
Copy link
Author

Same issue.
@AlexandreBonneau, have you planned to fix the issue?
@cristian-frumusanu , have you get a workaround?

@doucouredave

I think this works:

<VueAutonumeric @change.native="(event) => { yourVariable = event.target.value }" />

@doucouredave
Copy link

Thanks for you reply @cristian-frumusanu,
what does mean yourVariable? is it v-model?

@cristian-frumusanu
Copy link
Author

@doucouredave
yourVariable is just the variable name. It could be foo, bar, whatever.

So, if you would normally have

<VueAutonumeric v-model="yourVariable" />

to make this work you have to write:

<VueAutonumeric @change.native="(event) => { yourVariable = event.target.value }" />

@rylanb
Copy link

rylanb commented Aug 7, 2022

I was seeing a warning from AutoNumeric about the model being undefined. So I added :value="model" to ^^

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

No branches or pull requests

4 participants