Skip to content

Commit f0ec267

Browse files
author
AthiraKadampatta
committed
#3723 check for the preSelection props before resetting
1 parent 801c029 commit f0ec267

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/calendar.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,9 @@ export default class Calendar extends React.Component {
693693

694694
handleTodayButtonClick = (e) => {
695695
this.props.onSelect(getStartOfToday(), e);
696-
this.props.setPreSelection(getStartOfToday());
696+
this.props.setPreSelection && this.props.setPreSelection(getStartOfToday());
697697
};
698698

699-
700699
renderTodayButton = () => {
701700
if (!this.props.todayButton || this.props.showTimeSelectOnly) {
702701
return;

0 commit comments

Comments
 (0)