fix(gantt): use reactive date range in Flatpickr config to prevent reset on task update

Replace static initialDateRange snapshot with reactive filters.value
references inside the computed flatPickerConfig. This ensures the
Flatpickr defaultDate always reflects the current user-selected range
instead of the mount-time values.

Ref #2462
This commit is contained in:
kolaente
2026-04-02 18:55:13 +02:00
committed by kolaente
parent 23d9cbc664
commit d152fa8475

View File

@@ -146,13 +146,11 @@ const flatPickerDateRange = computed<Date[]>({
},
})
const initialDateRange = [filters.value.dateFrom, filters.value.dateTo]
const {t} = useI18n({useScope: 'global'})
const flatPickerConfig = computed(() => ({
altFormat: t('date.altFormatShort'),
altInput: true,
defaultDate: initialDateRange,
defaultDate: [filters.value.dateFrom, filters.value.dateTo],
enableTime: false,
mode: 'range',
locale: useFlatpickrLanguage().value,