A
A
Andy Oker2021-04-04 18:47:06
Vue.js
Andy Oker, 2021-04-04 18:47:06

When you enter a phone number in the input, an extra last character appears in the value value. Why?

There is such a field for a phone with a mask

<input type="text" name="phone" @input="test()" class="popup__input" ref="phone" v-imask="mask">

The test function is executed for it
test() {
  console.log(this.$refs.phone.value)
}

Mask:
mask: {
        mask: '+7 (000) 000 00 00',
        lazy: true,
}

In the console I get an extra character at the end and the length is always constant. Can you tell me how this can be avoided?
6069df778455c857448559.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Talalaev, 2021-04-04
@Ashlis

The library as a whole sometimes behaves strangely and inconveniently (they often still unsubscribe from me when using the bootstrap, everything is ok, probably something from yours interferes).
In short, try this:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question