react-bootstrap-datetimepicker
react-bootstrap-datetimepicker copied to clipboard
add disabled option
Can we add attribute like disabled={true} ?
+1
If you want to control the disabled state of this input, a simple manipulation of the DOM element using ref did the job for me.
For example:
<DateTimePicker
...
ref={(dateRef) => {
if (!disabled) {
return;
}
const dateTimePicker = dateRef && dateRef.refs && dateRef.refs.datetimepicker;
if (dateTimePicker) {
for (const domElem of dateTimePicker.childNodes) {
if (domElem.tagName === 'INPUT' && domElem.className === 'form-control') {
domElem.disabled = true;
}
}
}
}}/>