kekeh / angular-mydatepicker

Angular datepicker and date range picker :date:
https://kekeh.github.io/angular-mydatepicker/
MIT License
1 stars 11 forks source link

Keypress should not set the "touched" value #41

Closed matthew-wilson-itv closed 4 years ago

matthew-wilson-itv commented 4 years ago

I believe that the fix for issue #27 introduced an error.

Whenever the user types in the field, "touched" is set to true. This is not standard behaviour, as far as I can tell.

For example, https://angular.io/guide/form-validation says

  • When the user changes the value in the watched field, the control is marked as "dirty".
  • When the user blurs the form control element, the control is marked as "touched".

I think that onKeyUp should not be calling onTouchedCb.

kekeh commented 4 years ago

Hi @matthew-wilson-itv

I fixed this. Try version 0.7.0.