I’m trying to trigger a custom action onDayChange in the EventCalendar (React). When the day is selected I need to change the URL. However, if I implement the onDayChange event, the eventBubble no longer shows up. How can I implement a custom onDayChange event and also have the eventBubble show when the day is clicked?
The problem is probably that you are using an inline function and every time the calendar re-renders, there will an option call and that’s why the event bubble closes. Here is your solution:
// in case you're using class component
onDayChange = (event, inst) => { ... }
onDayChange={this.onDayChange}
// in case you're using functional component
const myChange = useCallback((event, inst) => { ... }, []);
<mobiscroll.Calendar onDayChange={myChange} />