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

Model has one more number that mask input #686

Open
leonardotdleal opened this issue Feb 12, 2022 · 1 comment
Open

Model has one more number that mask input #686

leonardotdleal opened this issue Feb 12, 2022 · 1 comment

Comments

@leonardotdleal
Copy link

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,
        }

image

Link JSFiddle: https://jsfiddle.net/wbxa59hg/

I' use in web application. :)

@ghost
Copy link

ghost commented Mar 18, 2022

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.
#630

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

No branches or pull requests

1 participant