cleave.js
cleave.js copied to clipboard
Model has one more number that mask input
Hello guys,
I'm using cleave.js with Vue.js, but I got a error when I use v-model with numeric mask. The model value has one more number that the input component, like the simulation.
{
blocks: [2, 3, 3, 4, 2],
delimiterLazyShow: true,
delimiters: ['.', '.', '/', '-'],
numericOnly: true,
}
Link JSFiddle: https://jsfiddle.net/wbxa59hg/
I' use in web application. :)
https://github.com/ankurk91/vue-cleave-component/blob/master/src/component.js
This seems to be a Vue issue, not a Cleave.js issue. Hi. I use vue-cleave-component, correctly solves your issue. I debugged the Cleave.js internals and it did not exceed the number of digits in the block.
{{inputValue}} is 111
new Cleave(this.$refs.input,{
onValueChanged:function(event){
console.dir(event.target.value) // 11! But {{inputValue}}} is 111
},
blocks: [2],
delimiterLazyShow: true,
numericOnly: true,
})
related to this issue. https://github.com/nosir/cleave.js/issues/630