aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndreas Fehn <andi.fehn@gmail.com>2017-02-04 08:10:23 +0100
committerAndreas Fehn <andi.fehn@gmail.com>2017-02-04 08:10:23 +0100
commit6d1ad104daefa7bc09dfdffd521541abf38dc6bc (patch)
treea2e4170271f33d027c081c327e02be816a5cccfd
parent74b83c4ad0b380a3a82c569c19267491af408684 (diff)
downloadtime-picker-6d1ad104daefa7bc09dfdffd521541abf38dc6bc.tar.gz
time-picker-6d1ad104daefa7bc09dfdffd521541abf38dc6bc.tar.zst
time-picker-6d1ad104daefa7bc09dfdffd521541abf38dc6bc.zip
Add prop for naming the input
-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()) || ''}