react-day-picker
react-day-picker copied to clipboard
You can select disabled dates if you write them in the input.
Bug description
You can select disabled dates if you write them in the input.
To reproduce
<DayPickerInput
dayPickerProps={{
modifiers: {
disabled: [{after: new Date()}]
}
}}
/>
Steps
- Write a future date, for example tomorrow (2021-12-29)
Expected behavior
I am not sure how it is suposed to behave the input if you select a disabled date.
Screenshots

For now I did this workaround:
onDayChange={(day: Date) => {=
const today = new Date().getDate();
if (day && day.getDate() > today) {
day.setDate(today);
}
setDate(day);
}}
Closing as we've released v8: this issue belongs to a version which is not longer maintained, and it is likely fixed. In case, please open a new issue. Thanks!