Fixes all-day event dragging issues
Addresses issues with dragging all-day events, ensuring correct event placement and layout calculations after a drag and drop operation. Specifically, ensures the correct event ID is used and updates the event layout when dragging all day events.
This commit is contained in:
parent
89e8a3f7b2
commit
576367974b
2 changed files with 6 additions and 2 deletions
|
|
@ -367,7 +367,7 @@ export class AllDayManager {
|
|||
|
||||
// 2. Normalize clone ID
|
||||
dragEndEvent.draggedClone.dataset.eventId = dragEndEvent.draggedClone.dataset.eventId?.replace('clone-', '');
|
||||
|
||||
dragEndEvent.originalElement.dataset.eventId += '_';
|
||||
|
||||
// 3. Create temporary array with existing events + the dropped event
|
||||
let eventId = dragEndEvent.draggedClone.dataset.eventId;
|
||||
|
|
@ -390,7 +390,10 @@ export class AllDayManager {
|
|||
};
|
||||
|
||||
// Use current events + dropped event for calculation
|
||||
const tempEvents = [...this.currentAllDayEvents, droppedEvent].except(dragEndEvent.originalElement);
|
||||
const tempEvents = [
|
||||
...this.currentAllDayEvents.filter(event => event.id !== eventId),
|
||||
droppedEvent
|
||||
];
|
||||
|
||||
// 4. Calculate new layouts for ALL events
|
||||
this.newLayouts = this.calculateAllDayEventsLayout(tempEvents, this.currentWeekDates);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue