Skip to content

Commit 1d9d1e9

Browse files
author
Tautvilas Mecinskas
committed
Merge branch 'master' of github.com:wix/react-native-calendars
2 parents 3d129d0 + 48de197 commit 1d9d1e9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/agenda/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)