]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
Add prop for naming the input
authorAndreas Fehn <andi.fehn@gmail.com>
Sat, 4 Feb 2017 07:10:23 +0000 (08:10 +0100)
committerAndreas Fehn <andi.fehn@gmail.com>
Sat, 4 Feb 2017 07:10:23 +0000 (08:10 +0100)
src/TimePicker.jsx

index ec3eda07573f10bf9b765d0d4306c0b43c91763d..e6c203159883c361e9628441e69da8fc77d73c78 100644 (file)
@@ -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({
           <input
             className={`${prefixCls}-input`}
             ref="picker" type="text" placeholder={placeholder}
+            name={name}
             readOnly
             onKeyDown={this.onKeyDown}
             disabled={disabled} value={value && value.format(this.getFormat()) || ''}