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