uNmAnNeR / imaskjs

vanilla javascript input mask
https://imask.js.org
MIT License
4.96k stars 258 forks source link

In MaskedEnum, block if it isn't the strict enum. #1029

Closed yertech closed 6 months ago

yertech commented 7 months ago

Describe the bug I have a mask for a Luxemburg phone like this :

mask: "{+352} 600 000 000",
blocks: {
  600: {
    mask: IMask.MaskedEnum,
    enum: ["691", "671", "661", "651", "621"],
  },
},

I want to limit the first block to that list of enums. But with that I can for exemple type 1 or 9 for the first number, if it's 691.

Expected behavior I would like to be able to type only 6 for the first number, 2, 5,6,7 or 9 for the second and 1 for the last. Is there any option to do that ?