[Vuejs]-Flatpickr: Trigger event only after selecting a date range

0👍

You can check if selectedDates.length === 2 in the onChange event. So put to flatpickr @on-change="updateTrigger" and then make function:

const updateTrigger = (selectedDates, dateStr, instance) => {
    if (selectedDates.length === 2) {
        $emit('update:filter', selectedDates);          
    }
};

Leave a comment