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

How to keep mask while user is typing #149

Open AlexandreLocas opened 4 years ago

AlexandreLocas commented 4 years ago

Hi, is there a way to keep mask displayed while user is typing ?

Thank you

eduPHP commented 4 years ago

You can make a wrapper div and set your input with transparent background and absolute position

<div  style="position: relative">
   <p>###.###.###</p>
  <input type="tel" v-mask="'###.###.###'" style="background: transparent; position: absolute; top: 0; left: 0;" />
</div>

Didn't test it but should work just fine

Manviel commented 3 years ago

It would be great to have somethink like that https://imask.js.org/guide.html#overwrite