Improves drag and drop for timed and all-day events

Refactors drag and drop handling to use a cloned event element,
ensuring correct positioning and styling during drag operations
for both regular timed events and all-day events.

This change streamlines the drag and drop process by:
- Creating a clone of the dragged event at the start of the drag.
- Passing the clone through the drag events.
- Handling all-day events with the AllDayManager
- Handling regular timed events with the EventRendererManager

This resolves issues with event positioning and styling during
drag, especially when moving events across columns or between
all-day and timed sections.
This commit is contained in:
Janus C. H. Knudsen 2025-09-26 22:53:49 +02:00
parent 0553089085
commit 9dfd4574d8
5 changed files with 62 additions and 45 deletions

View file

@ -46,6 +46,7 @@ export interface MousePosition {
// Drag start event payload
export interface DragStartEventPayload {
draggedElement: HTMLElement;
draggedClone: HTMLElement | null;
mousePosition: MousePosition;
mouseOffset: MousePosition;
column: string | null;
@ -90,6 +91,7 @@ export interface DragMouseLeaveHeaderEventPayload {
// Drag column change event payload
export interface DragColumnChangeEventPayload {
draggedElement: HTMLElement;
draggedClone: HTMLElement | null;
previousColumn: string | null;
newColumn: string;
mousePosition: MousePosition;