I’m running into a situation which I’m not sure how to handle with the Event Calendar.
I’m using onEventCreate to open a modal with a form when creating events. I also set several recurring invalid times during the week. Clicking on an invalid slot still triggers the onEventCreate. How can I prevent this?
Hi, for opening a modal on event creation, you can use the
This will not be fired if the event creation failed.
onEventCreate runs in the render phase, meaning that you cannot call state updates from there (e.g. opening a modal), unless you do it with a
setTimeout. On the other hand
onEventCreated will run when the render is finished and the DOM updates are ready.
Check our CRUD demo for a working implementation.