I'm using the following to prevent default on other input fields, but doesn't seem to work completely on my DayPickerInput.
//Prevent default function
onKeyPress = (event) => {
event.preventDefault();
}
//DayPickerInput
<DateObject
inputProps={
{className: 'pl2 br3 shadow-1 dropdownButtonDate', onKeyPress: this.onKeyPress}
}
value={selectedDay}
onDayChange={this.handleDayChange}
dayPickerProps={{
selectedDays: selectedDay,
disabledDays: [{
daysOfWeek: [0, 6],
},
{
before: new Date(this.dateRestriction())
}]
}}
/>
It doesn't let me write anything, which is great!
But when I tried to delete my date, it's allowing me to do so.
How could I stop this behavior?