| 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()`.|
| placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] |
| transitionName | String | '' | |
+| name | String | nothing | sets the name of the generated input |
## Test Case
onOpen: PropTypes.func,
onClose: PropTypes.func,
addon: PropTypes.func,
+ name: PropTypes.string,
},
getDefaultProps() {
},
getInitialState() {
+ this.saveInputRef = refFn.bind(this, 'picker');
this.savePanelRef = refFn.bind(this, 'panelInstance');
const { defaultOpen, defaultValue, open = defaultOpen, value = defaultValue } = this.props;
return {
},
focus() {
- this.refs.picker.focus();
+ this.picker.focus();
},
render() {
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;
<span className={`${prefixCls} ${className}`} style={style}>
<input
className={`${prefixCls}-input`}
- ref="picker" type="text" placeholder={placeholder}
+ ref={this.saveInputRef}
+ type="text"
+ placeholder={placeholder}
+ name={name}
readOnly
onKeyDown={this.onKeyDown}
disabled={disabled} value={value && value.format(this.getFormat()) || ''}