From 8fefeee393d7173a37734da7e34af5da64959214 Mon Sep 17 00:00:00 2001 From: Yadro Date: Fri, 15 Feb 2019 00:22:33 +0300 Subject: [PATCH] fix: allow override onShowMore callback (#1214) I've replaced `this._showMore` by callback from props. Seems it was added by mistake [here](https://github.com/intljusticemission/react-big-calendar/blob/f9a873368a78f5ced81b799c4dffe1095b3ab712/src/Calendar.jsx#L280), `_showMore` is always undefined. Here it will be execute: https://github.com/intljusticemission/react-big-calendar/blob/1d62c432eaa183ed6b38f08cfcec5ee7edcbfe41/src/Month.js#L300-L307 Related to #1147 --- src/Calendar.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Calendar.js b/src/Calendar.js index 72c7110e3..1504038ca 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -323,6 +323,15 @@ class Calendar extends React.Component { */ onSelecting: PropTypes.func, + /** + * Callback fired when a +{count} more is clicked + * + * ```js + * (events: Object, date: Date) => any + * ``` + */ + onShowMore: PropTypes.func, + /** * The selected event, if any. */ @@ -847,6 +856,7 @@ class Calendar extends React.Component { getNow, length, showMultiDayTimes, + onShowMore, components: _0, formats: _1, messages: _2, @@ -903,7 +913,7 @@ class Calendar extends React.Component { onSelectEvent={this.handleSelectEvent} onDoubleClickEvent={this.handleDoubleClickEvent} onSelectSlot={this.handleSelectSlot} - onShowMore={this._showMore} + onShowMore={onShowMore} /> )