react-google-flight-datepicker
react-google-flight-datepicker copied to clipboard
SingleDatePicker date switching bug
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)
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}
/>