diff options
author | Benjy Cui <benjytrys@gmail.com> | 2017-02-10 17:57:46 +0800 |
---|---|---|
committer | Benjy Cui <benjytrys@gmail.com> | 2017-02-10 17:57:46 +0800 |
commit | ed8496061a1535fb82503d9723a6014a85ee7625 (patch) | |
tree | 5dbcfdfbcc1311ce657a58d8f43c0da70c845ff7 | |
parent | 74b83c4ad0b380a3a82c569c19267491af408684 (diff) | |
download | time-picker-ed8496061a1535fb82503d9723a6014a85ee7625.tar.gz time-picker-ed8496061a1535fb82503d9723a6014a85ee7625.tar.zst time-picker-ed8496061a1535fb82503d9723a6014a85ee7625.zip |
feat: support .focus
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/TimePicker.jsx | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/package.json b/package.json index 1a4d828..1f8b474 100644 --- a/package.json +++ b/package.json | |||
@@ -49,7 +49,7 @@ | |||
49 | "jquery": "1.x", | 49 | "jquery": "1.x", |
50 | "pre-commit": "1.x", | 50 | "pre-commit": "1.x", |
51 | "rc-tools": "5.x", | 51 | "rc-tools": "5.x", |
52 | "rc-util": "^3.1.2", | 52 | "rc-util": "^4.0.0", |
53 | "react": "15.x", | 53 | "react": "15.x", |
54 | "react-addons-test-utils": "15.x", | 54 | "react-addons-test-utils": "15.x", |
55 | "react-dom": "15.x" | 55 | "react-dom": "15.x" |
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index ec3eda0..01bab2c 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -104,7 +104,7 @@ const Picker = React.createClass({ | |||
104 | 104 | ||
105 | onEsc() { | 105 | onEsc() { |
106 | this.setOpen(false); | 106 | this.setOpen(false); |
107 | this.refs.picker.focus(); | 107 | this.focus(); |
108 | }, | 108 | }, |
109 | 109 | ||
110 | onKeyDown(e) { | 110 | onKeyDown(e) { |
@@ -183,6 +183,10 @@ const Picker = React.createClass({ | |||
183 | } | 183 | } |
184 | }, | 184 | }, |
185 | 185 | ||
186 | focus() { | ||
187 | this.refs.picker.focus(); | ||
188 | }, | ||
189 | |||
186 | render() { | 190 | render() { |
187 | const { | 191 | const { |
188 | prefixCls, placeholder, placement, align, | 192 | prefixCls, placeholder, placement, align, |