diff --git a/public/js/modules/editor.js b/public/js/modules/editor.js index 8b7cf8f..bd7ebb4 100644 --- a/public/js/modules/editor.js +++ b/public/js/modules/editor.js @@ -231,7 +231,10 @@ export function openModal(card = null) { // bucket — they belong to a calendar, not a kanban column. For // every other new card, inherit the active real bucket if we're // in one so the user doesn't have to re-pick it. - const isNewAppointment = !card && /#(termin|geburtstag)\b/.test(body.value); + // `card` can be `null` (add-button new) or a shell `{id: null, ...}` + // from the calendar day-popup — both count as "new", so key on + // card?.id not the card ref itself. + const isNewAppointment = !card?.id && /#(termin|geburtstag)\b/.test(body.value); inpBucket.value = card?.bucket_id ? card.bucket_id : (isNewAppointment ? '' : (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''));