beholdr / maska

Simple zero-dependency input mask for Alpine.js, Svelte, Vue.js and vanilla JS.

Home Page:https://beholdr.github.io/maska

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IP mask doesn't work correctly

darkons opened this issue · comments

Describe the bug

When using the example IP mask, is not working on loaded and pasted values.

Steps to reproduce

Apply the example IP mask to your input and load/paste an IP like 140.55.150.80

<TextInput
  v-model="public_ip"
  v-maska
  data-maska="100.100.100.100"
  data-maska-tokens="1:[0-2]|0:[0-9]:optional"
  type="text"
/>

Reproduction link

https://stackblitz.com/edit/vue-maska-se3pwe

Not a bug, more like format question.
With given mask and tokens you should use zero-leading IP address, like 140.055.150.080
And if you want to use address like 140.55.150.80 then set tokens as 1:[0-9]|0:[0-9]:optional

Fixed!

Thank you so much and apologies for treating this as an issue. I'm a bit of a novice with masks logic.