From 9d1df0a5dc9f6d7464413e19cca18d86ca3b258a Mon Sep 17 00:00:00 2001 From: ddoe8 Date: Mon, 16 Dec 2024 21:08:58 +0100 Subject: [PATCH] fix(core): setting empty value in cat-time (#566) * fix(core): setting empty value in cat-time * fix(core): set newValue as undefined --------- Co-authored-by: DDoe --- core/src/components/cat-time/cat-time.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/components/cat-time/cat-time.tsx b/core/src/components/cat-time/cat-time.tsx index ac4150e2..6716dc4b 100644 --- a/core/src/components/cat-time/cat-time.tsx +++ b/core/src/components/cat-time/cat-time.tsx @@ -182,7 +182,7 @@ export class CatTime { this.valueChangedBySelection = false; } else if (value !== oldValue) { this.set12hFormat(); - this.syncValue(value); + this.syncValue(value ?? ''); } } @@ -243,7 +243,7 @@ export class CatTime { let newValue = this.value; if (!date) { this.selectionTime = null; - this.value = undefined; + newValue = undefined; } else { const time = clampTime(this.min ?? null, date, this.max ?? null); this.isAm = this.format(time).toLowerCase().includes('am');