ui-mask icon indicating copy to clipboard operation
ui-mask copied to clipboard

Request: mask based on input length

Open phazei opened this issue 9 years ago • 4 comments

It would be cool if the mask could change based on the length of the input: input: 1 mask-length-1: 9

input:1234 mask-length-4:9,999

input:12345 mask-length-5:99,999

input:1234567 mask-length-7:9,999,999

or after looking at that: mask-rtl:9?,9?9?9?,9?9?9?,9?9?9?,9?9?9? where it applies the mask right to left instead of left to right

phazei avatar Feb 02 '16 21:02 phazei

This seems more like a post processing step. Maybe in the $formatters so that it displays the separators in the viewValue only and doesn't persist to the model. Not sure if you want the separators to be included in the model value or not as that could change how this is implemented.

lukepfeiffer10 avatar Feb 03 '16 20:02 lukepfeiffer10

+1

ganholete avatar Aug 31 '16 17:08 ganholete

+1, that would allow form autocompletes to work with the masking, which is a big deal for my users. For example, I am using this mask to make a 16 digit number more legible. it is pretty common my users would need to enter the number more than once for searches, so re-entering the entire number from memory or copy/paste is kind of a pain. would be nice if autocomplete would work with it.

mistersender avatar Nov 04 '16 14:11 mistersender

Hi, Did you find a solution to this issue.

meer21 avatar Jul 19 '17 14:07 meer21