ui-mask
ui-mask copied to clipboard
Request: mask based on input length
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
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.
+1
+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.
Hi, Did you find a solution to this issue.