You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is working as expected: by filtering out letters before setting myNumericValue, this variable never changes and never triggers a re render, so the value on the input is preserved.
One way to get around this is to force update with this.$forceUpdate() after changing the value. A better way is to reset the input's value only:
Version
2.6.10
Reproduction link
https://codesandbox.io/s/vue-template-8sl0s?fontsize=14
Steps to reproduce
What is expected?
State's
numericValue
should be equal to DOM'sinput.value
What is actually happening?
State's
numericValue
and DOM'sinput.value
are different.I am trying to make an input that only accepts numbers as it's value.
In the codesandbox you'll see another exemple with "uppercase" that has the expecting behaviour.
I've openned a topic on forum.vuejs.org with no success :
https://forum.vuejs.org/t/filter-out-letters-from-an-input-to-only-keep-numbers/76205
The text was updated successfully, but these errors were encountered: