aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
author偏右 <afc163@gmail.com>2017-02-20 15:59:58 +0800
committerGitHub <noreply@github.com>2017-02-20 15:59:58 +0800
commitee6394229b2340c70c342851ecf5dba3462ac4ef (patch)
tree98c76dec8cf04bdd52183bf519c982391b103f3e /src
parent8c2e96b8ab6688db31b811946213af9b0bff8f84 (diff)
parent679773bb9664038f2f00e2b6d5e9c9d30b96acd1 (diff)
downloadtime-picker-ee6394229b2340c70c342851ecf5dba3462ac4ef.tar.gz
time-picker-ee6394229b2340c70c342851ecf5dba3462ac4ef.tar.zst
time-picker-ee6394229b2340c70c342851ecf5dba3462ac4ef.zip
Merge pull request #30 from fehnomenal/add-name-prop
Add prop for naming the input
Diffstat (limited to 'src')
-rw-r--r--src/TimePicker.jsx4
1 files changed, 3 insertions, 1 deletions
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({
41 onOpen: PropTypes.func, 41 onOpen: PropTypes.func,
42 onClose: PropTypes.func, 42 onClose: PropTypes.func,
43 addon: PropTypes.func, 43 addon: PropTypes.func,
44 name: PropTypes.string,
44 }, 45 },
45 46
46 getDefaultProps() { 47 getDefaultProps() {
@@ -187,7 +188,7 @@ const Picker = React.createClass({
187 const { 188 const {
188 prefixCls, placeholder, placement, align, 189 prefixCls, placeholder, placement, align,
189 disabled, transitionName, style, className, showHour, 190 disabled, transitionName, style, className, showHour,
190 showMinute, showSecond, getPopupContainer, 191 showMinute, showSecond, getPopupContainer, name,
191 } = this.props; 192 } = this.props;
192 const { open, value } = this.state; 193 const { open, value } = this.state;
193 let popupClassName; 194 let popupClassName;
@@ -213,6 +214,7 @@ const Picker = React.createClass({
213 <input 214 <input
214 className={`${prefixCls}-input`} 215 className={`${prefixCls}-input`}
215 ref="picker" type="text" placeholder={placeholder} 216 ref="picker" type="text" placeholder={placeholder}
217 name={name}
216 readOnly 218 readOnly
217 onKeyDown={this.onKeyDown} 219 onKeyDown={this.onKeyDown}
218 disabled={disabled} value={value && value.format(this.getFormat()) || ''} 220 disabled={disabled} value={value && value.format(this.getFormat()) || ''}