Improves all-day event drag and drop

Refactors all-day event conversion during drag and drop to
use the event payload, improving code clarity and reducing
redundancy.

Removes unnecessary style settings and fixes column detection
logic. Addresses an issue where event removal occurred before
successful placement.
This commit is contained in:
Janus C. H. Knudsen 2025-09-29 20:50:52 +02:00
parent 8b5420f367
commit 83e01f9cb7
7 changed files with 29 additions and 49 deletions

View file

@ -304,7 +304,8 @@ export abstract class BaseEventRenderer implements EventRendererStrategy {
this.removeEventFromExistingGroups(originalElement);
// Fade out original
this.fadeOutAndRemove(originalElement);
// TODO: this should be changed into a subscriber which only after a succesful placement is fired, not just mouseup as this can remove elements that are not placed.
this.fadeOutAndRemove(originalElement);
// Remove clone prefix and normalize clone to be a regular event
const cloneId = draggedClone.dataset.eventId;
@ -450,7 +451,7 @@ export abstract class BaseEventRenderer implements EventRendererStrategy {
*/
/**
* Fade out and remove element
* Fade out and remove element
*/
private fadeOutAndRemove(element: HTMLElement): void {
element.style.transition = 'opacity 0.3s ease-out';