diff --git a/examples/src/components/App.js b/examples/src/components/App.js index 4f70bb5..ca0e12a 100644 --- a/examples/src/components/App.js +++ b/examples/src/components/App.js @@ -48,6 +48,13 @@ export default class App extends Component { +
+ + + +
; }`; +const basicAutoDatePickerCode = `render() { + return ; +}`; + const clearDatePickerCode = `render() { return ( diff --git a/src/components/DatePicker.js b/src/components/DatePicker.js index 2520c63..f7ea40f 100644 --- a/src/components/DatePicker.js +++ b/src/components/DatePicker.js @@ -21,13 +21,15 @@ export default class DatePicker extends Component { removable: PropTypes.bool, timePickerComponent: PropTypes.func, calendarStyles: PropTypes.object, - calendarContainerProps: PropTypes.object + calendarContainerProps: PropTypes.object, + closeOnSelect: PropTypes.bool }; static defaultProps = { inputFormat: 'jYYYY/jM/jD', calendarStyles: require('../styles/basic.css'), - calendarContainerProps: {} + calendarContainerProps: {}, + closeOnSelect: false }; state = { @@ -98,6 +100,7 @@ export default class DatePicker extends Component { } this.setMomentValue(momentValue); + this.setState({isOpen: !this.props.closeOnSelect}) } handleInputChange(event) {