I am using DayPickerInput and want user should not be able to edit the date field manually. I tried passing prop 'readOnly' but it's not working.
Here's the snippet-
import DayPickerInput from 'react-day-picker/DayPickerInput';
import {formatDate} from 'react-day-picker/moment';
<DayPickerInput
readOnly
onDayChange={this.handleDayChange.bind(this, 'maximumDeliveryDate')}
format="DD/MM/YYYY"
formatDate={formatDate}
placeholder="DD/MM/YYYY"
value={this.state.maximumDeliveryDate}
dayPickerProps={{
selectedDays: this.state.selectedDay,
disabledDays: {before: new Date()}
}}/>
Am I using the correct prop or is there any other prop to do this?
Worked by passing
inputProps={{readOnly: true}} to component.
Ofcourse this thing was mentioned in the documentation, somehow I feel it was not clear.
Closing the issue.
Most helpful comment
Worked by passing
inputProps={{readOnly: true}} to component.
Ofcourse this thing was mentioned in the documentation, somehow I feel it was not clear.
Closing the issue.