diff options
author | 偏右 <afc163@gmail.com> | 2017-02-20 16:02:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-20 16:02:11 +0800 |
commit | 66c7bc36856bbabb4ff73a3ccf671448eed1f359 (patch) | |
tree | d06f2e3b8e267c242863d10bb983352440ca00b7 | |
parent | fa912931fa6952cf85fe4b35bd15cd83f3e32876 (diff) | |
parent | ee6394229b2340c70c342851ecf5dba3462ac4ef (diff) | |
download | time-picker-66c7bc36856bbabb4ff73a3ccf671448eed1f359.tar.gz time-picker-66c7bc36856bbabb4ff73a3ccf671448eed1f359.tar.zst time-picker-66c7bc36856bbabb4ff73a3ccf671448eed1f359.zip |
Merge branch 'master' into fix-ref-error
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | src/TimePicker.jsx | 8 |
3 files changed, 8 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index e780b32..d2c1fdb 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -7,7 +7,7 @@ notifications: | |||
7 | - yiminghe@gmail.com | 7 | - yiminghe@gmail.com |
8 | 8 | ||
9 | node_js: | 9 | node_js: |
10 | - 4.0.0 | 10 | - 6 |
11 | 11 | ||
12 | before_install: | 12 | before_install: |
13 | - | | 13 | - | |
@@ -71,6 +71,7 @@ API | |||
71 | | 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()`.| | 71 | | 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()`.| |
72 | | placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] | | 72 | | placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] | |
73 | | transitionName | String | '' | | | 73 | | transitionName | String | '' | | |
74 | | name | String | nothing | sets the name of the generated input | | ||
74 | 75 | ||
75 | 76 | ||
76 | ## Test Case | 77 | ## Test Case |
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 28857a0..da47ac4 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() { |
@@ -188,7 +189,7 @@ const Picker = React.createClass({ | |||
188 | const { | 189 | const { |
189 | prefixCls, placeholder, placement, align, | 190 | prefixCls, placeholder, placement, align, |
190 | disabled, transitionName, style, className, showHour, | 191 | disabled, transitionName, style, className, showHour, |
191 | showMinute, showSecond, getPopupContainer, | 192 | showMinute, showSecond, getPopupContainer, name, |
192 | } = this.props; | 193 | } = this.props; |
193 | const { open, value } = this.state; | 194 | const { open, value } = this.state; |
194 | let popupClassName; | 195 | let popupClassName; |
@@ -213,7 +214,10 @@ const Picker = React.createClass({ | |||
213 | <span className={`${prefixCls} ${className}`} style={style}> | 214 | <span className={`${prefixCls} ${className}`} style={style}> |
214 | <input | 215 | <input |
215 | className={`${prefixCls}-input`} | 216 | className={`${prefixCls}-input`} |
216 | ref={this.saveInputRef} type="text" placeholder={placeholder} | 217 | ref={this.saveInputRef} |
218 | type="text" | ||
219 | placeholder={placeholder} | ||
220 | name={name} | ||
217 | readOnly | 221 | readOnly |
218 | onKeyDown={this.onKeyDown} | 222 | onKeyDown={this.onKeyDown} |
219 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} | 223 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} |