vuejs-tips / vue-the-mask

Tiny (<2k gzipped) and dependency free mask input for Vue.js
https://vuejs-tips.github.io/vue-the-mask/
1.72k stars 212 forks source link

Mask Component has a problem with value set (v-model) #153

Open A7I7BEK opened 4 years ago

A7I7BEK commented 4 years ago

Description of the problem

I faced with the problem when I re-set the value (set, clear, and set again) to the mask component using v-model

Mask Settings

Expected result

According to nature of the mask component, it re-evaluates the set value, omits predefined values (+998) and returns plain numbers (901234567).

Actual result

However, re-evaluation doesn't work when you re-set the same value again. For example, I set "+998901234567" value, cleared it, and re-set the same value. The re-evaluated output was:

  1. "901234567"
  2. ""
  3. "+998901234567"

Example

Link to codesandbox: https://codesandbox.io/s/vue-the-mask-component-error-ngwot?file=/src/App.vue