Improves drag and drop functionality and fixes issues

Refactors drag and drop logic to dynamically find the dragged element, ensuring correct behavior even when the DOM changes during the drag operation.

Creates all-day container if it doesn't exist.

This resolves issues where drag and drop operations would fail if the original element was no longer present in the DOM or if the container didn't exist.
This commit is contained in:
Janus Knudsen 2025-09-13 20:47:42 +02:00
parent 7054c0d40a
commit 9cdf4fbe96
4 changed files with 58 additions and 19 deletions

View file

@ -157,6 +157,19 @@ swp-calendar-header {
/* Firefox - hide scrollbar but keep space */
scrollbar-width: auto; /* Normal width to match content scrollbar */
/* All-day events container */
swp-allday-container {
grid-column: 1 / -1;
grid-row: 2;
display: grid;
grid-template-columns: repeat(var(--grid-columns, 7), minmax(var(--day-column-min-width), 1fr));
grid-template-rows: repeat(1, auto);
gap: 2px;
padding: 2px;
align-items: center;
overflow: hidden;
}
scrollbar-color: transparent transparent;
}