diff --git a/package.json b/package.json index ff73e6e434..c31eacda8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/ccd-case-ui-toolkit", - "version": "1.0.2", + "version": "1.0.3", "description": "Case UI Toolkit", "main": "./dist/index.umd.js", "module": "./dist/index.js", diff --git a/src/components/form/date-input/date-input.component.ts b/src/components/form/date-input/date-input.component.ts index d54c0a6f45..f3f87d7387 100644 --- a/src/components/form/date-input/date-input.component.ts +++ b/src/components/form/date-input/date-input.component.ts @@ -1,4 +1,4 @@ -import { Component, forwardRef, Input } from '@angular/core'; +import {Component, forwardRef, Input, OnDestroy} from '@angular/core'; import { AbstractControl, FormControl, ValidationErrors } from '@angular/forms'; import { ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator } from '@angular/forms'; @@ -18,7 +18,7 @@ import { ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator } fro } ], }) -export class DateInputComponent implements ControlValueAccessor, Validator { +export class DateInputComponent implements ControlValueAccessor, Validator, OnDestroy { @Input() public id: string; @@ -73,6 +73,12 @@ export class DateInputComponent implements ControlValueAccessor, Validator { // Do nothing. } + public ngOnDestroy() { + this.validate = (control: AbstractControl): ValidationErrors => { + return undefined; + }; + } + public dayChange(event: any) { // get value from input this.day = event.target.value;