aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
author偏右 <afc163@gmail.com>2017-02-20 16:03:58 +0800
committerGitHub <noreply@github.com>2017-02-20 16:03:58 +0800
commit2f8835c7ed1457c9e9f80556ed001cba87c1c6a9 (patch)
treed4d7f3cb8ad22cfed3a5f39408a4953b9844bf4c
parent46e5fd60344c4fa718117e82153773ab0d15ebfc (diff)
parentdd63e6e7fa1d600d3656a4edbe5f5fc5410f443a (diff)
downloadtime-picker-2f8835c7ed1457c9e9f80556ed001cba87c1c6a9.tar.gz
time-picker-2f8835c7ed1457c9e9f80556ed001cba87c1c6a9.tar.zst
time-picker-2f8835c7ed1457c9e9f80556ed001cba87c1c6a9.zip
Merge pull request #31 from react-component/feat-focus
feat: support .focus
-rw-r--r--package.json2
-rw-r--r--src/TimePicker.jsx6
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 da47ac4..aa3e0da 100644
--- a/src/TimePicker.jsx
+++ b/src/TimePicker.jsx
@@ -106,7 +106,7 @@ const Picker = React.createClass({
106 106
107 onEsc() { 107 onEsc() {
108 this.setOpen(false); 108 this.setOpen(false);
109 this.picker.focus(); 109 this.focus();
110 }, 110 },
111 111
112 onKeyDown(e) { 112 onKeyDown(e) {
@@ -185,6 +185,10 @@ const Picker = React.createClass({
185 } 185 }
186 }, 186 },
187 187
188 focus() {
189 this.picker.focus();
190 },
191
188 render() { 192 render() {
189 const { 193 const {
190 prefixCls, placeholder, placement, align, 194 prefixCls, placeholder, placement, align,