-
Notifications
You must be signed in to change notification settings - Fork 27.4k
custom directive and ng-pattern interfere in rc.2 #9156
Comments
This is because the value passed to your parser is |
did we ever mark that as a breaking change? I know someone asked for it to be documented in the changelog |
Is this an identical issue to #8290 then? I would have liked to see it in the changelog as well. |
I'm still too new to do it correctly. :-/ |
I'm not sure when we changed this --- it might have been db044c4 but I'm not positive. If I can sort out when this broke I'll make sure it's documented |
Throwing another hat into the ring: the actual cause is 3e51b84 $render now checks if the $modelValue is empty before calling val() with the $viewValue. This doesn't really make sense, or rather it locks $render into a single use case, model -> view updates. If we want to check for empty values before rendering, we need a different way. What happens in the issue here is that $render sets the input to empty string, but the $viewValue stays correct. This confuses the whole processing. Imo $render should be dumb and only set the .val() |
$render should only be concerned if there is a $viewValue present. When we check $isEmpty($modelValue), we assume $render is used in context of a model -> view update. But since it is part of the public API, it needs to work independent of internal usage. Fixes angular#9156
$render should only be concerned if there is a $viewValue present. When we check $isEmpty($modelValue), we assume $render is used in context of a model -> view update. But since it is part of the public API, it needs to work independent of internal usage. Fixes angular#9156
This is fixed in 1.3.4 :) |
http://plnkr.co/edit/dbvC9NWcZTpWRRiUTkJU?p=preview
A custom directive (to convert a text input to all-caps as the user types), combined with a
ng-pattern
for validation, prevents any text from being entered into the text input.Key HTML:
JS:
In rc.2, I type in the text field and nothing appears. This code works fine in rc.1 and previous versions.
If I remove either the custom directive JS or the
ng-pattern
attribute, the text field displays text again in rc.2The text was updated successfully, but these errors were encountered: