]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
add autocomplete option
authorAdam Misiorny <adam.misiorny@gmail.com>
Thu, 1 Sep 2016 07:06:56 +0000 (09:06 +0200)
committerAdam Misiorny <adam.misiorny@gmail.com>
Thu, 1 Sep 2016 07:06:56 +0000 (09:06 +0200)
README.md
src/TimePicker.jsx

index 3ae31aa911f5f191de53d22900db8577ecc866a6..5d8822a49a537fb55fde019079940690d201b1a3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -69,6 +69,7 @@ API
 | onChange                | Function                          | null                                          | called when select a different value                                                       |
 | placement               | String                            | bottomLeft                                    | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] |
 | transitionName          | String                            | ''                                            |                                                                                            |
+| autoComplete            | String                            | 'yes'                                         | one of ['yes', 'no']                                                                       |
 
 
 ## Test Case
index 58f6ea13be6f1ed29751c885d17996b90c24d6d8..da0c57bbd589906b3787cda74a3aab376109a301 100644 (file)
@@ -39,6 +39,7 @@ const Picker = React.createClass({
     onChange: PropTypes.func,
     onOpen: PropTypes.func,
     onClose: PropTypes.func,
+    autoComplete: PropTypes.string,
   },
 
   getDefaultProps() {
@@ -61,6 +62,7 @@ const Picker = React.createClass({
       onChange: noop,
       onOpen: noop,
       onClose: noop,
+      autoComplete: 'yes',
     };
   },
 
@@ -182,7 +184,7 @@ const Picker = React.createClass({
     const {
       prefixCls, placeholder, placement, align,
       disabled, transitionName, style, className, showHour,
-      showSecond, getPopupContainer,
+      showSecond, getPopupContainer, autoComplete,
     } = this.props;
     const { open, value } = this.state;
     let popupClassName;
@@ -211,6 +213,7 @@ const Picker = React.createClass({
             readOnly
             onKeyDown={this.onKeyDown}
             disabled={disabled} value={value && value.format(this.getFormat()) || ''}
+            autoComplete={autoComplete}
           />
           <span className={`${prefixCls}-icon`}/>
         </span>