I have an issue with the current binding of (eventClicked) and (eventTimesChanged) using angular calendar when my events are both draggable and clickable.
NOTE: This behavior seems to happen on Firefox v84.0.2 but not on Chrome v87.0.4280.88
Dragging an event from one time slot to another sometimes triggers eventTimesChanged AND eventClicked when only the first one would have been expected.
This situation happens:
Using this stackblitz sandbox and by following the scenariis below, you can understand the behavior:
Is there any way to block this eventClicked trigger after a drag and drop on the same day ? I feel like the event detection considers that a mouse click down + mouse click up on one event the same day will always be considered as a click, even if the time slot of the event when clicking down the mouse is different from the time slot of the event when the mouse click is released.
I feel like adding a kind of "delay detection" between the mouse click and the mouse release to define whether it should be considered as a click or a "hold then release" of the event should be sufficient as a workaround, but I don't know how to put it together in that way.
Thank you by advance
Here is the workaround I came up with. Not sure about its performances but it is working: Modify the component having the angular calendar doing these 3 points
export class MyClassContainingCalendarBindedMethods {
private eventHasChangedSubject = new BehaviorSubject<boolean>(false);
eventTimesChanged(event: CalendarEventTimesChangedEvent): void {
this.eventHasChangedSubject.next(true);
yourCurrentEventTimesChangedCode();
setTimeout(() => this.eventHasChangedSubject.next(false), 1);
}
eventClicked({ event }: { event: CalendarEvent }): void {
if (!this.eventHasChangedSubject.value) {
yourCurrentEventClickedCode();
}
}
}