candreoliveira / ngMask

Best Angular mask alternative! No jQuery, pure JS. About ~6kb!
http://candreoliveira.github.io/#/ngMask
ISC License
419 stars 171 forks source link

Leading Zeros getting removed #143

Open OwenMelbz opened 7 years ago

OwenMelbz commented 7 years ago

Hey,

I've got this input

<input pattern="\d*" mask="99999999" ng-change="updateApplication()" required type="number" ng-model="application.number">

This is for a a 8 digit string

Things like

11111111 and 22222222 work, however if i do something like 001 then the leading zeros get stripped out, the moment you type in a non-zero character it gets removed

Gif below demonstrates

bug maybe

fredlemieux commented 7 years ago

Try changing the type = "number" to type ="tel"