Skip to content

Commit 4f29be4

Browse files
committed
fix: allow datepicker to send empty values
1 parent ac95c58 commit 4f29be4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/packages/property-editors/date-picker/property-editor-ui-date-picker.element.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ export class UmbPropertyEditorUIDatePickerElement extends UmbLitElement implemen
7575
#onChange(event: CustomEvent & { target: UmbInputDateElement }) {
7676
let value = event.target.value.toString();
7777

78+
if (!value) {
79+
this.#syncValue(undefined);
80+
return;
81+
}
82+
7883
switch (this._inputType) {
7984
case 'time':
8085
value = `0001-01-01 ${value}`;
@@ -120,7 +125,7 @@ export class UmbPropertyEditorUIDatePickerElement extends UmbLitElement implemen
120125
}
121126
}
122127

123-
#syncValue(value: string) {
128+
#syncValue(value?: string) {
124129
const valueHasChanged = this.value !== value;
125130
if (valueHasChanged) {
126131
this.value = value;

0 commit comments

Comments
 (0)