I want to disable DayPickerInput, when I'll get date from API, or whatever.
I didn't find anything about my issue in docs.
inputProps={{disabled: true, readOnly: true }}
works, but not so well, whatever I can click on input, end dayPicker will appear, and I'll be able to change date as normal...
DayPickerInput does not take in disabled prop. You could use input box to get past this issue:
disabled ? <input value={}> : <DayPickerInput/>
Hello! I added disabling this way:
import DayPickerInput from 'react-day-picker/DayPickerInput';
import cn from 'classnames';
<DayPickerInput
inputProps={{
className: cn(
'ant-input',
className,
{
'ant-input-disabled': disabled
}
),
disabled: disabled
}}
/>
@Meloman4eg adding a className shouldn't solve this issue, as the overlay will appear on click even if the field is marked as disabled. I think I should check the inputProps and disable the click event there.
The support for disabled inputs is on v7.1.6
Most helpful comment
The support for disabled inputs is on v7.1.6