diff --git a/frontend/src/lib/components/common/InlineCalendarInput.svelte b/frontend/src/lib/components/common/InlineCalendarInput.svelte index 2ef2e4bd2f..7c20af8e74 100644 --- a/frontend/src/lib/components/common/InlineCalendarInput.svelte +++ b/frontend/src/lib/components/common/InlineCalendarInput.svelte @@ -63,9 +63,18 @@ type Props = (DateProps | RangeProps) & { class?: string + // Portal the month/year dropdowns to the body so they escape an `overflow` + // ancestor (e.g. a scroll-contained popover). Off by default: in-flow. + portalSelects?: boolean } - let { mode = 'date', value = $bindable(), class: className, ...rest }: Props = $props() + let { + mode = 'date', + value = $bindable(), + class: className, + portalSelects = false, + ...rest + }: Props = $props() const onClickBehavior = $derived( mode === 'range' ? ((rest as RangeProps).onClickBehavior ?? 'set-range') : 'set-range' @@ -425,14 +434,14 @@ (viewYear = parseInt(val) || viewYear)} items={YEAR_LIST.map((year) => ({ label: year.toString(), value: year }))} diff --git a/frontend/src/lib/components/runs/TimeframeSelect.svelte b/frontend/src/lib/components/runs/TimeframeSelect.svelte index cc5a99f70c..f8d2b0df71 100644 --- a/frontend/src/lib/components/runs/TimeframeSelect.svelte +++ b/frontend/src/lib/components/runs/TimeframeSelect.svelte @@ -78,6 +78,8 @@ + + +{#snippet presetButtons()} + {#each items as item (item.label)} + + {/each} +{/snippet} +
- {/each} + {#if isSmall} +
+
+ {@render presetButtons()} +
+
+ + {#snippet children({ item })} + + + {/snippet} + + range, + (v) => + onManualInput( + smallBound === 'end' + ? { maxTs: fromCalendarDate(v.end)?.toISOString() ?? null } + : { minTs: fromCalendarDate(v.start)?.toISOString() ?? null } + ) + } + /> +
- range, - (v) => onManualInput({ minTs: fromCalendarDate(v.start)?.toISOString() ?? null }) - } - /> - range, - (v) => onManualInput({ maxTs: fromCalendarDate(v.end)?.toISOString() ?? null }) - } - /> -
+ {:else} +
+
+ {@render presetButtons()} +
+ range, + (v) => onManualInput({ minTs: fromCalendarDate(v.start)?.toISOString() ?? null }) + } + /> + range, + (v) => onManualInput({ maxTs: fromCalendarDate(v.end)?.toISOString() ?? null }) + } + /> +
+ {/if} {/snippet}