Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datepicker): Changed handling of value change #328

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix(datepicker): Changed handling of value change #328

wants to merge 2 commits into from

Conversation

rastr5189
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant