Skip to content

Commit

Permalink
fix(core): setting empty value in cat-time (#566)
Browse files Browse the repository at this point in the history
* fix(core): setting empty value in cat-time

* fix(core): set newValue as undefined

---------

Co-authored-by: DDoe <daniel.doe@coyoapp.com>
  • Loading branch information
ddoe8 and DDoe authored Dec 16, 2024
1 parent 11407b3 commit 9d1df0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/components/cat-time/cat-time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class CatTime {
this.valueChangedBySelection = false;
} else if (value !== oldValue) {
this.set12hFormat();
this.syncValue(value);
this.syncValue(value ?? '');
}
}

Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 9d1df0a

Please # to comment.