assisrafael / angular-input-masks

Opinionated input masks for AngularJS
http://assisrafael.github.io/angular-input-masks/
MIT License
963 stars 329 forks source link

ui-br-car-plate-mask: incorrect validation when letter typed instead of number #317

Closed ingridtartaglia closed 6 years ago

ingridtartaglia commented 7 years ago

Version: 2.6.0 (angular-input-masks) and 1.6 (angular.js) Browsers: Chrome (but I think it's not related to browsers and their versions)

When I type a car plate with 3 letters, 3 numbers and 1 letter again, the ui-br-car-plate-mask won't show the last letter in the end, but it will hide the validation error, as it was a valid plate:

image

In the screenshot above, I tried to type the following plate: ABC-123A. It should be an error validation, because this model is not allowed here in Brazil (the 4 last digits must be numbers).

Other issue I've noticed in the example above is: despite the last digit isn't appear in the input, it's stored in the ng-model:

image

Obs: if I try to enter car plates like ABC-12AA, ABC-1AAA ou ABC-AAAA, a validation error is shown and these values won't be included in the ng-model. These behaviors are ok.

Can someone help me, please?