autoNumeric + Vue.js 2.0 : autoNumeric does not see value updates made via Vue
See original GitHub issueI’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 samev-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:
- Created 7 years ago
- Comments:42 (36 by maintainers)
Top GitHub Comments
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.
@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