Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "feature",
"message": "Add 'clear' button to the date input element.",
"issue_origin": "github",
"issue_number": 5202,
"domain": "builder",
"bullet_points": [],
"created_at": "2026-04-21"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
@blur="handleTimeBlur($event)"
/>
</div>
<i
v-if="dateInputValue"
class="ab-datetime-picker__clear button-icon__icon iconoir-cancel"
@click="clearValue"
/>
<Context
ref="dateContext"
:hide-on-click-outside="true"
Expand Down Expand Up @@ -246,6 +251,13 @@ export default {
this.updateTime(event.target.value)
this.$refs.timeContext.hide()
},
clearValue() {
this.$refs.dateContext.hide()
if (this.includeTime) {
this.$refs.timeContext.hide()
}
this.$emit('update:modelValue', null)
},
},
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
var(--input-horizontal-padding, 12px);
}

.ab-datetime-picker__clear {
cursor: pointer;
color: var(--input-text-color, $black);
flex-shrink: 0;
margin-left: auto;

&:hover {
opacity: 0.7;
}
}

.ab-datetime-picker__input {
&.ab-input {
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
<div>
<!--v-if-->
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -90,6 +91,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
<div>
<!--v-if-->
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -143,6 +145,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
<div>
<!--v-if-->
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -201,6 +204,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
value=""
/>
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -259,6 +263,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
value=""
/>
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -317,6 +322,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
value=""
/>
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -375,6 +381,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
value=""
/>
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -433,6 +440,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
value=""
/>
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down Expand Up @@ -491,6 +499,7 @@ exports[`DateTimePickerElement > placeholder corresponds to date and time format
value=""
/>
</div>
<!--v-if-->
</div>

<!--v-if-->
Expand Down
Loading