-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ngMaxLength with integer only input fails #7848
Comments
Hm, in this plunker, $error.maxlength becomes true if I have more than 8 characters in the input: http://plnkr.co/edit/od2qLXAncyy73FAdqlng?p=preview So this works. Are your refering to a specific behavior? (In beta.12, the behavior changed insofar that invalid model values will show in the bound input regardless of validity.) |
@Narretz you mean that when the validity is failing then the model value will not show up at all. |
@matsko that has always been the case, iirc. The other way round is new (invalid model shows in input). Might actually be a breaking change if you think about it. |
Yes it could be overly strict. I think we need another property on ngModel that is there no matter what: #6740 (comment) |
…th and ngMaxlength Fixes angular#7848
The example above has a mistake: It should be Initially, there is no validation error. But when you change the number, the model value gets cleared and the validation error is shown. So this is a legit bug! |
Might be fixed via #7968 though... |
That PR should fix it, but it's a good point that it doesn't really make sense for numbers, in general, but it might be good to support for url/email. |
The bug is fixed when tested on master: http://plnkr.co/edit/0HKYThxJWZIoHvQIgaol?p=preview |
the bug is still happening there with the snapshot script, @matsko |
Sorry, my mistake, I though that we were paying attention to the error and not the model value. |
well, there's a fix for this but I haven't heard any comments about it =( moving this to the next milestoneeeeee |
As far as I can see the bug in http://plnkr.co/edit/FPYKrOrTrWKf6PnoaYro?p=preview is fixed in the current snapshot. |
ngMaxlength seem to be coercing the input value to int? I have
which
user.data.numero = 232
, and it's failing. if I type "n232" it works. Using latest 1.3.0 beta 12The text was updated successfully, but these errors were encountered: