From 041807ff7847f58eec03577b235c3e594fc4c63c Mon Sep 17 00:00:00 2001 From: ali Date: Wed, 9 Aug 2017 17:12:57 +0430 Subject: [PATCH] fix calendar container props --- src/components/DatePicker.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/DatePicker.js b/src/components/DatePicker.js index 2520c63..c5bd7e6 100644 --- a/src/components/DatePicker.js +++ b/src/components/DatePicker.js @@ -150,7 +150,10 @@ export default class DatePicker extends Component { renderCalendar() { const { momentValue } = this.state; const { timePickerComponent: TimePicker, onChange, min, max, defaultMonth, calendarStyles, calendarContainerProps } = this.props; - + const updatedProps = {...calendarContainerProps, + onSelect: (selected) => {this.handleSelectDay.bind(this)(selected); calendarContainerProps.hasOwnProperty('onSelect') && calendarContainerProps.onSelect(selected)}, + onClickOutside: () => {this.handleClickOutsideCalendar(); calendarContainerProps.hasOwnProperty('onClickOutside') && calendarContainerProps.onClickOutside()} + } return (
+ {...updatedProps}> { TimePicker ? (