angular-ui / ui-mask

Mask on an input field so the user can only type pre-determined pattern
https://htmlpreview.github.io/?https://github.com/angular-ui/ui-mask/master/demo/index.html
MIT License
391 stars 257 forks source link

Add option to reverse fill #238

Open Alanzhoffmann opened 6 years ago

Alanzhoffmann commented 6 years ago

An issue I've found is when the first characters are optional, I have to fill them anyway for my mask to actually work.

<input ng-model="time" ui-mask="9?9?9:99" />

Filling it from right to left would make it possible to type 545 and it show up 5:45 instead of 545:__ as it is. Additionally it would be perfect if I could type infinitely for it to mask only the end, something like

<input ng-model="time" ui-mask="9#9:99" />

so typing 113534 would show 1135:34