From 1ab6d07c1338a132380f24d211d0b8fc2de2ba1a Mon Sep 17 00:00:00 2001 From: tshimber Date: Wed, 4 Dec 2024 15:49:38 +0100 Subject: [PATCH] fix: check for querySelector value added --- .../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 5a15423b68..b74d30e4ac 100644 --- a/packages/components/src/components/date-picker/date-picker.tsx +++ b/packages/components/src/components/date-picker/date-picker.tsx @@ -226,9 +226,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; + } } /**