diff options
Diffstat (limited to 'src/TimePicker.jsx')
-rw-r--r-- | src/TimePicker.jsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index ec3eda0..28857a0 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -69,6 +69,7 @@ const Picker = React.createClass({ | |||
69 | }, | 69 | }, |
70 | 70 | ||
71 | getInitialState() { | 71 | getInitialState() { |
72 | this.saveInputRef = refFn.bind(this, 'picker'); | ||
72 | this.savePanelRef = refFn.bind(this, 'panelInstance'); | 73 | this.savePanelRef = refFn.bind(this, 'panelInstance'); |
73 | const { defaultOpen, defaultValue, open = defaultOpen, value = defaultValue } = this.props; | 74 | const { defaultOpen, defaultValue, open = defaultOpen, value = defaultValue } = this.props; |
74 | return { | 75 | return { |
@@ -104,7 +105,7 @@ const Picker = React.createClass({ | |||
104 | 105 | ||
105 | onEsc() { | 106 | onEsc() { |
106 | this.setOpen(false); | 107 | this.setOpen(false); |
107 | this.refs.picker.focus(); | 108 | this.picker.focus(); |
108 | }, | 109 | }, |
109 | 110 | ||
110 | onKeyDown(e) { | 111 | onKeyDown(e) { |
@@ -212,7 +213,7 @@ const Picker = React.createClass({ | |||
212 | <span className={`${prefixCls} ${className}`} style={style}> | 213 | <span className={`${prefixCls} ${className}`} style={style}> |
213 | <input | 214 | <input |
214 | className={`${prefixCls}-input`} | 215 | className={`${prefixCls}-input`} |
215 | ref="picker" type="text" placeholder={placeholder} | 216 | ref={this.saveInputRef} type="text" placeholder={placeholder} |
216 | readOnly | 217 | readOnly |
217 | onKeyDown={this.onKeyDown} | 218 | onKeyDown={this.onKeyDown} |
218 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} | 219 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} |