]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
feat: support .focus
authorBenjy Cui <benjytrys@gmail.com>
Fri, 10 Feb 2017 09:57:46 +0000 (17:57 +0800)
committerBenjy Cui <benjytrys@gmail.com>
Fri, 10 Feb 2017 09:57:46 +0000 (17:57 +0800)
package.json
src/TimePicker.jsx

index 1a4d8280cc5547a0643fe36fcc9c6d1e6997a646..1f8b474abb9099213fea9e6c11e916328f6cf9fa 100644 (file)
@@ -49,7 +49,7 @@
     "jquery": "1.x",
     "pre-commit": "1.x",
     "rc-tools": "5.x",
-    "rc-util": "^3.1.2",
+    "rc-util": "^4.0.0",
     "react": "15.x",
     "react-addons-test-utils": "15.x",
     "react-dom": "15.x"
index ec3eda07573f10bf9b765d0d4306c0b43c91763d..01bab2c5b5185e33ba0431ac200da40c441725ab 100644 (file)
@@ -104,7 +104,7 @@ const Picker = React.createClass({
 
   onEsc() {
     this.setOpen(false);
-    this.refs.picker.focus();
+    this.focus();
   },
 
   onKeyDown(e) {
@@ -183,6 +183,10 @@ const Picker = React.createClass({
     }
   },
 
+  focus() {
+    this.refs.picker.focus();
+  },
+
   render() {
     const {
       prefixCls, placeholder, placement, align,