Skip to content

Fix End Date/Time overlapping Start Date/Time on submission forms [#310]#311

Merged
dgershman merged 1 commit into
mainfrom
feature/mayo-310-submission-hours-overlay
Jul 10, 2026
Merged

Fix End Date/Time overlapping Start Date/Time on submission forms [#310]#311
dgershman merged 1 commit into
mainfrom
feature/mayo-310-submission-hours-overlay

Conversation

@dgershman

Copy link
Copy Markdown
Contributor

Closes #310

Problem

After #300 (PR #305) replaced the native <input type="time"> on the event and announcement submission forms with Hour/Minute/AM-PM <select> dropdowns, the End Date/Time field visually overlapped the Start Date/Time field (reported on 1.9.2-beta1).

Root cause

The two date/time fields sit side-by-side in .mayo-datetime-group. The shipped global rule .mayo-form-field select { width: 100% } applies to the new time <select>s:

  • Hour / Minute survive it — .mayo-time-inputs select { flex: 1; min-width: 0 } gives flex-basis: 0%, which overrides width for flex sizing.
  • AM/PM does not — .mayo-time-inputs .mayo-time-ampm { flex: 0 0 auto } wins on specificity, so flex-basis: auto falls back to width: 100%. Being non-shrinkable (flex-shrink: 0), it becomes rigidly 100% of its container and overflows the column, spilling onto the adjacent field.

Fix

Add width: auto to .mayo-time-inputs select so the shipped width: 100% no longer forces the AM/PM select to fill/overflow the flex container. CSS-only (public.css is enqueued directly — no JS rebuild), and both the event and announcement forms share this structure so both are fixed.

Testing

  • Rendered [mayo_event_form] / [mayo_announcement_form] at ~615px (matching the report): Start and End columns now sit side-by-side with no overlap; AM/PM sits inline after Minute within its own column.
  • 24-hour mode (time_format="24hour", no AM/PM select) and the ≤600px stacked layout both unchanged.
  • Values still store as canonical HH:mm (layout-only change).

The Start/End time dropdowns added in #300 inherit the global
`.mayo-form-field select { width: 100% }` rule. The Hour/Minute selects
survive it via `flex: 1; min-width: 0` (flex-basis 0% overrides width),
but the AM/PM select uses `flex: 0 0 auto`, so its flex-basis falls back
to the 100% width and, being non-shrinkable, overflows its column and
overlaps the neighbouring Start/End Date/Time field.

Add `width: auto` to `.mayo-time-inputs select` so the shipped 100% width
no longer forces the AM/PM select to fill the flex container. CSS-only;
fixes both the event and announcement submission forms.

🐦‍⬛ Generated with Claude Code, orchestrated by Crow

Co-Authored-By: Claude <noreply@anthropic.com>
Crow-Session: 68239712-69AB-4E49-A896-D58AF3985DC1
Claude-Session: https://claude.ai/code/session_01QoNs9nVtYEEwhvFw3PV9eF
@dgershman dgershman merged commit a01da02 into main Jul 10, 2026
3 checks passed
@dgershman dgershman deleted the feature/mayo-310-submission-hours-overlay branch July 10, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ref: #305 - Submission Start/End Hours now dropdown + formatting

1 participant