File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ theme={{
236236}}
237237```
238238
239- ** Disclaimer** : issues that arise because something breaks after using stylesheet override will not be supported. Use this option at your own risk.
239+ ** Disclaimer** : issues that arise because something breaks after using stylesheet override will not be supported. Use this option at your own risk.
240240
241241### CalendarList
242242
@@ -280,6 +280,8 @@ An advanced agenda component that can display interactive listings for calendar
280280 }}
281281 // callback that gets called when items for a certain month should be loaded (month became visible)
282282 loadItemsForMonth= {(month ) => {console .log (' trigger items loading' )}}
283+ // callback that fires when the calendar is opened or closed
284+ onCalendarToggled= {(calendarOpened ) => {console .log (calendarOpened)}}
283285 // callback that gets called on day press
284286 onDayPress= {(day )=> {console .log (' day pressed' )}}
285287 // callback that gets called when day changes while scrolling agenda list
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ export default class AgendaView extends Component {
3737
3838 // callback that gets called when items for a certain month should be loaded (month became visible)
3939 loadItemsForMonth : PropTypes . func ,
40+ // callback that fires when the calendar is opened or closed
41+ onCalendarToggled : PropTypes . func ,
4042 // callback that gets called on day press
4143 onDayPress : PropTypes . func ,
4244 // callback that gets called when day changes while scrolling agenda list
@@ -213,6 +215,9 @@ export default class AgendaView extends Component {
213215 this . setState ( {
214216 calendarScrollable : true
215217 } ) ;
218+ if ( this . props . onCalendarToggled ) {
219+ this . props . onCalendarToggled ( true ) ;
220+ }
216221 // Enlarge calendarOffset here as a workaround on iOS to force repaint.
217222 // Otherwise the month after current one or before current one remains invisible.
218223 // The problem is caused by overflow: 'hidden' style, which we need for dragging
@@ -234,6 +239,9 @@ export default class AgendaView extends Component {
234239 calendarScrollable : false ,
235240 selectedDay : day . clone ( )
236241 } ) ;
242+ if ( this . props . onCalendarToggled ) {
243+ this . props . onCalendarToggled ( false ) ;
244+ }
237245 if ( ! optimisticScroll ) {
238246 this . setState ( {
239247 topDay : day . clone ( )
You can’t perform that action at this time.
0 commit comments