Skip to content

Commit

Permalink
When time picker is displayed close picker when time is selected
Browse files Browse the repository at this point in the history
Don't close picker when only date is selected
  • Loading branch information
CI Builds committed Dec 11, 2017
1 parent cf2ca74 commit 7ab731e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export default class DatePicker extends React.Component {
}
)
this.setSelected(date, event)
if (!this.props.shouldCloseOnSelect) {
if (!this.props.shouldCloseOnSelect || this.props.showTimeSelect) {
this.setPreSelection(date)
} else if (!this.props.inline) {
this.setOpen(false)
Expand Down Expand Up @@ -323,6 +323,7 @@ export default class DatePicker extends React.Component {
})

this.props.onChange(changedDate)
this.setOpen(false);
}

onInputClick = () => {
Expand Down

0 comments on commit 7ab731e

Please sign in to comment.