Closed mei-rong-ding closed 6 years ago
I see the same happening as well. Once I add the TrimValueAccessorModule plugin class="ng-untouched" shows up for inputs that have had focus and then lost it. If I remove TrimValueAccessorModule, the inputs behave as expected on touch. Any suggestions as to how to fix this or when can we expect a fix? Thanks.
I have submitted a PR which fixes this issue.
The problem is the directive is missing the host parameters which the DefaultValueAccessor directive has:
Namely '(blur)': 'onTouched()'
There are some other host parameters there which are also missing. Not really sure what effect their absence has though.
If you want to fix this in your own project you can just create your own directive with the code from PR #20.
We do the validation for the inputs, some are required. So we need to show error message if user click in and click out with nothing filled in. The input node has "ng-untouched" property, it should be changed to "ng-touched" after user click in, but it is not after using "ng-trim-value-accessor"