react-google-flight-datepicker icon indicating copy to clipboard operation
react-google-flight-datepicker copied to clipboard

SingleDatePicker date switching bug

Open oleholei opened this issue 2 years ago • 1 comments

Steps for reproduce:

  • When Mounting the component, I set the default date by startDate prop. (Screen 1)

  • Switch the picker on one month earlier (Screen 2)

  • I want to switch to current month back, but the 'next' arrow is disabled (Screen 2, right arrow is disabled)

  • when i click on different days on picker a few times, the 'next' arrow is disabled (Screen 3)

  • when i click on the datepicker block arrows (when dropp-picker is not dropped) and switch day to current month and then change the day on dropped picker, the arrow becomes available (Screen 4)

  • But by switching the month by arrows, layout of picker comes invalid (Screen 5, 6)

Screenshot 2022-03-14 at 14 53 20

image

image

Screenshot 2022-03-14 at 14 54 04

image

image

oleholei avatar Mar 14 '22 12:03 oleholei

The component code in the project:

<SingleDatePicker 
        singleCalendar 
        highlightToday
        dateFormat={calendarFormat} // "DD-MM-YYYY"
        startWeekDay="monday"
        startDate={date} // current date on mount
        maxDate={DateUtils.maxDate} // Date of today
        minDate={DateUtils.minDate} // Date of 5 years ago
        startDatePlaceholder={`${dayMonthPlaceholder}-${dayMonthPlaceholder}-${yearPlaceholder}`} // "__-__-___"
        onChange={onChange}
        disabled={disabled}
/>

oleholei avatar Mar 14 '22 12:03 oleholei