question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autoNumeric + Vue.js 2.0 : autoNumeric does not see value updates made via Vue

See original GitHub issue

I’m having trouble making autoNumeric work well with Vue.js 2.0.

Everything looks like it’s working (even pasting!), but with one small caveat ; having two inputs,

  • either they share the same v-model (the javascript variable that Vue databind to the html element, which mean that when you change the data in one input, all the other elements sharing the same v-model sees their values updated accordingly),
  • or when one input value change, Vue updates the second input value accordingly

…whenever you input a number in the first input, both inputs shows the updated value, but, if you focus on the second input, autoNumeric reverts the updated value to the old one it somehow ‘stored’ at one point.

It seems Vue.js updates the input value, but autoNumeric does not see that change happening, hence it somehow keeps the previous value and shows it on focus.

cf. the codepen where you can see that happening.

Would you see how to fix that? Does autoNumeric store the input value that gets displayed on focus? Is there a way or a function to update that value when modifying the input value via javascript, and not via a normal user input?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:42 (36 by maintainers)

github_iconTop GitHub Comments

2reactions
BobKnothecommented, Nov 8, 2016

I like your idea of having an option that is ASP.net specific.

Modifying the anDefault that checks the rawValue versus the input value seems logical or adding a new option is also an alternative.

Will keep you informed.

1reaction
BobKnothecommented, Nov 12, 2016

@AlexandreBonneau,

I made a mod for the Vue.js issue that IMHO is a good compromise

Can you test and close the issue if you are satisfied

Bob

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make autoNumeric work correctly with Vue.js 2?
I'm trying to create a Vue.js 2 directive that activate the autoNumeric jquery plugin on the input it is declared on.
Read more >
autoNumeric/autoNumeric - Gitter
Hi guys, I have a question. I have a numeric input for which I want to set a minimum value. If I set...
Read more >
autonumeric - UNPKG
The CDN for autonumeric. ... an AutoNumeric object with the `null` value is not allowed since using ... 636, + Fixed issue with...
Read more >
AutoNumeric.js
The <input> element below is managed by AutoNumeric. Try changing its value and see how the underlying rawValue is modified: The rawValue is...
Read more >
autoNumeric & Vue 2 directive + dispatch event = no need for ...
So, until there is a way to be able to use autoNumeric 2.0 like before, ... when two inputs do not share a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found