ng2-semantic-ui icon indicating copy to clipboard operation
ng2-semantic-ui copied to clipboard

fix(datepicker): Changed handling of value change

Open rastr5189 opened this issue 7 years ago • 0 comments

Thank you in advance that you make this library.

I tried to resolve bug i have found.

From angular docs for ControlValueAccessor: writeValue - This method will be called by the forms API to write to the view when programmatic (model -> view) changes are requested. onChange - ... update the form model when values propagate from the view (view -> model).

There was call from writeValue method to onChange event. That makes control dirty for initial value. I have added new event onViewValueChange used to update input value.

I have changed how value is set from input to component. Changing value trough input changes model -> should fire onChange event and not call writeValue.

I made little change in documentation - IMHO there was missing ngModel atribute.

rastr5189 avatar Nov 29 '17 21:11 rastr5189