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

$setPristine() $setUntouched() Should reset control mask validity #74

Open chandramuralis opened 9 years ago

chandramuralis commented 9 years ago

In one of the form I'm using ng-mask in one of my input controls and I set the mask pattern as mask="9999999999999999" which basically should accept 16 digit number. I also have the reset button in the form on which I'm calling form.$setPristine() and form.$setUntouched() to reset the form. If I start entering numbers in the field the form controls $error.mask property is set to 'true'. When I reset my form this mask property is not removed and causing my form to be invalid.

chandramuralis commented 9 years ago

I've created a plnkr to show this issue. Try to enter 2 digit number in text box and see that 'mask' property on $error is set to true. When you hit 'Reset' button, the 'mask' property is not resetting and causing the form still to be invalid.

xcytek commented 8 years ago

I had a similar issue, I tried to get a phone number from other model and when assign to the model with mask = (999) 999-9999, the mask is missing.

brunowego commented 7 years ago

Yep, get this issue here. Any idea how solve? Thanks.

brunowego commented 7 years ago

@chandramuralis @xcytek have find a way to fix it?

chandramuralis commented 7 years ago

@brunowego Nope I don't have any direct fix for this yet.

brunowego commented 7 years ago

@chandramuralis I change to https://github.com/angular-ui/ui-mask and works nice.

chandramuralis commented 7 years ago

@brunowego Even I started using it in jy other projects.. I'm having different issue with that one too.