From 4d23fae9ad1d1238dfdecf9694adfa36313c6651 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 9 Jan 2022 14:11:28 +0100 Subject: [PATCH] fix: reset the flatpickr range when setting a date either manually or through a quick setting --- src/components/date/datepickerWithRange.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index 7808d442..6cfdda2b 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -27,7 +27,7 @@ {{ $t('input.datepickerRange.from') }}
- +
@@ -38,7 +38,7 @@ {{ $t('input.datepickerRange.to') }}
- +
@@ -95,6 +95,11 @@ function emitChanged() { }) } +function inputChanged() { + flatpickrRange.value = '' + emitChanged() +} + watch( () => flatpickrRange.value, (newVal: string | null) => { @@ -119,7 +124,7 @@ function setDateRange(range: string[] | null) { if (range === null) { from.value = '' to.value = '' - emitChanged() + inputChanged() return } @@ -127,7 +132,7 @@ function setDateRange(range: string[] | null) { from.value = range[0] to.value = range[1] - emitChanged() + inputChanged() } const dateRanges = {