Improves all-day event layout and drag behavior

Refactors all-day event layout calculation and rendering for improved accuracy and performance.

Improves drag-and-drop behavior for all-day events, ensuring correct event placement and column detection.

Addresses issues with event overflow display and provides a more responsive user experience.
This commit is contained in:
Janus C. H. Knudsen 2025-10-01 18:41:28 +02:00
parent 6a17bba343
commit ae3aab5dd0
5 changed files with 50 additions and 66 deletions

View file

@ -243,8 +243,10 @@ export class DragDropManager {
// Check for column change using cached data
const newColumn = ColumnDetectionUtils.getColumnBounds(currentPosition);
if (newColumn == null)
return;
if (newColumn && newColumn !== this.currentColumnBounds) {
if (newColumn?.index !== this.currentColumnBounds?.index) {
const previousColumn = this.currentColumnBounds;
this.currentColumnBounds = newColumn;
@ -279,7 +281,7 @@ export class DragDropManager {
// Detect drop target (swp-day-column or swp-day-header)
const dropTarget = this.detectDropTarget(mousePosition);
if(!dropTarget)
if (!dropTarget)
throw "dropTarget is null";
console.log('🎯 DragDropManager: Emitting drag:end', {
@ -298,7 +300,9 @@ export class DragDropManager {
target: dropTarget
};
this.eventBus.emit('drag:end', dragEndPayload);
this.draggedElement = null;
} else {
// This was just a click - emit click event instead