The DayPilot.Calendar.stopDragging() method cancels any active drag and drop operation (JavaScript Calendar component):
Available since version 2022.3.5416.
DayPilot.Calendar.stopDragging()
This method needs to be called as a static method, not on a DayPilot.Calendar instance:
DayPilot.Calendar.stopDragging();
The following example handles an escape key press and cancels ongoing drag and drop actions:
window.addEventListener("keydown", (ev) => { if (ev.key === "Escape") { DayPilot.Calendar.stopDragging(); } });