bug: fixed calender modal stacking issue #209

Merged
hodlbod merged 2 commits from DeveshSingh/flotilla:fix/calender-modal-bug into dev 2026-04-16 14:55:37 +00:00
Contributor

Fix #205: Calendar event form borked

Problem

The date picker calendar popup in the Create/Edit Event form rendered behind adjacent form fields (End date, Location, Time input), making it impossible to select dates without the calendar being obscured.

The DateTimeInput component had no stacking context, so the absolutely-positioned calendar popup from date-picker-svelte followed default DOM paint order — later siblings (End field, Location field) always rendered on top of earlier siblings' popups (Start field's calendar).

What changed

Updated src/lib/components/DateTimeInput.svelte

  • Added focus-within:z-modal on the root container so whichever date picker is actively focused dynamically elevates above all sibling fields
  • Added z-popover on the date input wrapper so the calendar popup renders above the adjacent time input
  • Added group + group-focus-within:opacity-0 + group-focus-within:pointer-events-none on the icon overlay so the calendar/clear icon hides and becomes non-interactive when the picker popup is open, preventing ghost clicks that would close the calendar
  • Added pointer-events-auto on icon buttons so they remain clickable when the overlay is not in focus-within state

Behavior after fix

  • Start date picker popup renders above the End field and Location field
  • End date picker popup renders above the Location field
  • Neither picker permanently traps the other — only the active one elevates
  • Calendar icon overlay does not intercept clicks when the popup is open
  • Single click on the date input opens the calendar (no double-click needed)

Manual verification

  1. Open app locally and navigate to any Space
  2. Go to Calendar tab → click Create Event
  3. Click the Start date input — calendar popup should render above End and Location fields
  4. Select a date, then click the End date input — calendar popup should render above Location field

Scope

  • Single-file change (DateTimeInput.svelte)
# Fix #205: Calendar event form borked ## Problem The date picker calendar popup in the Create/Edit Event form rendered **behind** adjacent form fields (End date, Location, Time input), making it impossible to select dates without the calendar being obscured. The `DateTimeInput` component had no stacking context, so the absolutely-positioned calendar popup from `date-picker-svelte` followed default DOM paint order — later siblings (End field, Location field) always rendered on top of earlier siblings' popups (Start field's calendar). ## What changed ### Updated `src/lib/components/DateTimeInput.svelte` - Added `focus-within:z-modal` on the root container so whichever date picker is actively focused dynamically elevates above all sibling fields - Added `z-popover` on the date input wrapper so the calendar popup renders above the adjacent time input - Added `group` + `group-focus-within:opacity-0` + `group-focus-within:pointer-events-none` on the icon overlay so the calendar/clear icon hides and becomes non-interactive when the picker popup is open, preventing ghost clicks that would close the calendar - Added `pointer-events-auto` on icon buttons so they remain clickable when the overlay is not in focus-within state ## Behavior after fix - **Start** date picker popup renders above the End field and Location field - **End** date picker popup renders above the Location field - Neither picker permanently traps the other — only the active one elevates - Calendar icon overlay does not intercept clicks when the popup is open - Single click on the date input opens the calendar (no double-click needed) ## Manual verification 1. Open app locally and navigate to any Space 2. Go to **Calendar** tab → click **Create Event** 3. Click the **Start** date input — calendar popup should render above End and Location fields 4. Select a date, then click the **End** date input — calendar popup should render above Location field ## Scope - Single-file change (`DateTimeInput.svelte`)
DeveshSingh added 1 commit 2026-04-15 22:31:25 +00:00
Owner

Looks good, only thing is can you use rhe z stack defined in the tailwind config file

Looks good, only thing is can you use rhe z stack defined in the tailwind config file
DeveshSingh added 1 commit 2026-04-16 12:06:50 +00:00
Author
Contributor

Hey @hodlbod, I used z-modal and z-popover now, according to the tailwind config file

Hey @hodlbod, I used z-modal and z-popover now, according to the tailwind config file
Collaborator

Hey @DeveshSingh, could you also update the PR description to reflect the Tailwind z-index changes? It still mentions z-50 and z-20.

Hey @DeveshSingh, could you also update the PR description to reflect the Tailwind z-index changes? It still mentions z-50 and z-20.
hodlbod merged commit 0658a8ee44 into dev 2026-04-16 14:55:37 +00:00
hodlbod deleted branch fix/calender-modal-bug 2026-04-16 14:55:37 +00:00
Sign in to join this conversation.