From 0414a01666ca1a4b8f6ed25fff0150f4b1eb6d6f Mon Sep 17 00:00:00 2001 From: Julian Date: Sat, 10 Mar 2018 12:22:02 -0500 Subject: Add id to input element --- src/TimePicker.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index a37fec2..6de48b3 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -55,6 +55,7 @@ export default class Picker extends Component { focusOnOpen: PropTypes.bool, onKeyDown: PropTypes.func, autoFocus: PropTypes.bool, + id: PropTypes.string, }; static defaultProps = { @@ -85,6 +86,7 @@ export default class Picker extends Component { use12Hours: false, focusOnOpen: false, onKeyDown: noop, + id: '', }; constructor(props) { @@ -253,7 +255,7 @@ export default class Picker extends Component { render() { const { - prefixCls, placeholder, placement, align, + prefixCls, placeholder, placement, align, id, disabled, transitionName, style, className, getPopupContainer, name, autoComplete, onFocus, onBlur, autoFocus, inputReadOnly, } = this.props; @@ -290,6 +292,7 @@ export default class Picker extends Component { autoFocus={autoFocus} onChange={noop} readOnly={!!inputReadOnly} + id={id} /> -- cgit v1.2.3 From 4dc88036b4a4e077a5e7d5208ea3d100816a8a25 Mon Sep 17 00:00:00 2001 From: Julian Date: Sat, 10 Mar 2018 12:23:40 -0500 Subject: update README --- README.md | 1 + src/TimePicker.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3baa0ce..c0ce889 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ API | value | moment | null | current value | | placeholder | String | '' | time input's placeholder | | className | String | '' | time picker className | +| id | String | '' | time picker id | | popupClassName | String | '' | time panel className | | showHour | Boolean | true | whether show hour | | | showMinute | Boolean | true | whether show minute | diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 6de48b3..26166f4 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -66,6 +66,7 @@ export default class Picker extends Component { style: {}, className: '', popupClassName: '', + id: '', align: {}, defaultOpenValue: moment(), allowEmpty: true, @@ -86,7 +87,6 @@ export default class Picker extends Component { use12Hours: false, focusOnOpen: false, onKeyDown: noop, - id: '', }; constructor(props) { -- cgit v1.2.3