Skip to content

Commit

Permalink
Merge pull request #97 from Julian-Jurai/add-id-attribute-to-input-el
Browse files Browse the repository at this point in the history
Add id to input element
  • Loading branch information
yesmeck authored Mar 12, 2018
2 parents 0cb7397 + 4dc8803 commit 77862ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
5 changes: 4 additions & 1 deletion src/TimePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class Picker extends Component {
focusOnOpen: PropTypes.bool,
onKeyDown: PropTypes.func,
autoFocus: PropTypes.bool,
id: PropTypes.string,
};

static defaultProps = {
Expand All @@ -65,6 +66,7 @@ export default class Picker extends Component {
style: {},
className: '',
popupClassName: '',
id: '',
align: {},
defaultOpenValue: moment(),
allowEmpty: true,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -290,6 +292,7 @@ export default class Picker extends Component {
autoFocus={autoFocus}
onChange={noop}
readOnly={!!inputReadOnly}
id={id}
/>
<span className={`${prefixCls}-icon`}/>
</span>
Expand Down

0 comments on commit 77862ae

Please sign in to comment.