Flatpickr 在没有选择时选择今天的关闭日期

El *_*imo 6 reactjs flatpickr

当我打开然后关闭 Flatpickr 实例而不选择日期时,它会将其设置为今天的日期。如何防止这种行为?当用户未设置时,我需要日期输入保持为空。

Flatpickr 实例用 React-Flatpickr 包装。

<Flatpickr
    ref={fpStartDate}
    className='th-input-container__input'
    value={startDate}
    onClose={(selectedDates, dateStr, instance) => { 
        if (selectedDates.length > 0) {
            setInputValue(1);
            setCurrentPage(1);
            setStartDate(selectedDates[0]);
        }
    }}
    options={{
        enableTime: true,
        enableSeconds: true,
        dateFormat: 'd.m.Y, H:i:S',
        locale: Russian,
        mode: 'single',
        time_24hr: true,
        minuteIncrement: 1,
        allowInput: true,
        disableMobile: true,
        monthSelectorType: 'dropdown',
        onOpen: function(selectedDates, dateStr, instance) {
            setTimeout(function() {
                instance.open();
            }, 200);
        }
    }}
    placeholder='from'
/>
Run Code Online (Sandbox Code Playgroud)

El *_*imo 0

原来这是某个版本以来的一个错误。确切的版本号可以在 Flatpickr GitHub issues 中找到。我选择的解决方案是降级。