aavanzyl / ngx-tiny

Implementation of Light Weight Angular Components for Production Applications
https://aavanzyl.github.io/ngx-tiny
MIT License
7 stars 3 forks source link

initializing date input with 'null' value triggers angular 'required' error upon entering valid date 1st time #21

Open kaydeejay opened 3 years ago

kaydeejay commented 3 years ago

Describe the bug ngx-tiny/date-picker @10.0.2 angular @12.0.3 storybook @6.3

When using date input with datepicker, initializing input with 'null' value triggers angular "required" date-picker-required-error2 error state upon entering in a valid date. Error goes away upon re-entering the same date or another valid date.

export const datepickerCtrl = new FormControl(null, [
  VUI_VALIDATORS.date('M/D/YYYY'),
  Validators.required
]);

replacing null with new Date() removes this behavior, but desired behavior would be to be able to initialize the input as blank.

Versions (please complete the following information):