From fa912931fa6952cf85fe4b35bd15cd83f3e32876 Mon Sep 17 00:00:00 2001 From: Andreas Fehn Date: Sat, 4 Feb 2017 07:57:06 +0100 Subject: Fix react error about refs --- src/TimePicker.jsx | 5 +++-- 1 file 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({ }, getInitialState() { + this.saveInputRef = refFn.bind(this, 'picker'); this.savePanelRef = refFn.bind(this, 'panelInstance'); const { defaultOpen, defaultValue, open = defaultOpen, value = defaultValue } = this.props; return { @@ -104,7 +105,7 @@ const Picker = React.createClass({ onEsc() { this.setOpen(false); - this.refs.picker.focus(); + this.picker.focus(); }, onKeyDown(e) { @@ -212,7 +213,7 @@ const Picker = React.createClass({ Date: Sat, 4 Feb 2017 08:10:23 +0100 Subject: Add prop for naming the input --- src/TimePicker.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index ec3eda0..e6c2031 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -41,6 +41,7 @@ const Picker = React.createClass({ onOpen: PropTypes.func, onClose: PropTypes.func, addon: PropTypes.func, + name: PropTypes.string, }, getDefaultProps() { @@ -187,7 +188,7 @@ const Picker = React.createClass({ const { prefixCls, placeholder, placement, align, disabled, transitionName, style, className, showHour, - showMinute, showSecond, getPopupContainer, + showMinute, showSecond, getPopupContainer, name, } = this.props; const { open, value } = this.state; let popupClassName; @@ -213,6 +214,7 @@ const Picker = React.createClass({ Date: Sat, 4 Feb 2017 08:35:28 +0100 Subject: Update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 05182c2..4a36815 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ API | addon | Function | nothing | called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like `panel.close()`.| | placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] | | transitionName | String | '' | | +| name | String | nothing | sets the name of the generated input | ## Test Case -- cgit v1.2.3 From 8c2e96b8ab6688db31b811946213af9b0bff8f84 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 20 Feb 2017 15:59:45 +0800 Subject: upgrade travis node --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e780b32..d2c1fdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ notifications: - yiminghe@gmail.com node_js: -- 4.0.0 +- 6 before_install: - | -- cgit v1.2.3