},
getInitialState() {
+ this.saveInputRef = refFn.bind(this, 'picker');
this.savePanelRef = refFn.bind(this, 'panelInstance');
const { defaultOpen, defaultValue, open = defaultOpen, value = defaultValue } = this.props;
return {
onEsc() {
this.setOpen(false);
- this.refs.picker.focus();
+ this.picker.focus();
},
onKeyDown(e) {
<span className={`${prefixCls} ${className}`} style={style}>
<input
className={`${prefixCls}-input`}
- ref="picker" type="text" placeholder={placeholder}
+ ref={this.saveInputRef} type="text" placeholder={placeholder}
readOnly
onKeyDown={this.onKeyDown}
disabled={disabled} value={value && value.format(this.getFormat()) || ''}