From dac9e93f2f30ef18d84d586a74b200476646148a Mon Sep 17 00:00:00 2001 From: tshimber <110041439+tshimber@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:13:07 +0100 Subject: [PATCH] fix(date-picker): check for querySelector value added (#2374) --- .../src/components/date-picker/date-picker.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/date-picker/date-picker.tsx b/packages/components/src/components/date-picker/date-picker.tsx index a202a02a30..ce73c2046c 100644 --- a/packages/components/src/components/date-picker/date-picker.tsx +++ b/packages/components/src/components/date-picker/date-picker.tsx @@ -230,9 +230,12 @@ export class DatePicker { */ @Watch('value') onValueChange() { - this.hasValue = this.value != null && this.value !== ''; - // @ts-ignore - this.duetInput.querySelector('.duet-date__input').value = this.value; + this.hasValue = this.value !== null && this.value !== ''; + const input = this.duetInput.querySelector('.duet-date__input'); + if (input) { + // @ts-ignore + input.value = this.value; + } } /**