fix(demos): bound format popover width and keep mobile trigger reachable

This commit is contained in:
maoyingjie
2026-10-28 17:49:49 +08:00
parent 1029444a98
commit 462044c3b8
4 changed files with 7 additions and 20 deletions
@@ -107,7 +107,7 @@ const hourCycleOptions: { label: string; value: HourCycle }[] = [
];
</script>
<template>
<div class="flex w-full flex-col gap-4">
<div class="flex w-full min-w-0 flex-col gap-4 overflow-x-auto">
<DateRangePicker
:key="granularity"
class="w-max min-w-80"
@@ -137,11 +137,11 @@ const hourCycleOptions: { label: string; value: HourCycle }[] = [
</DateRangePickerTrigger>
</DateFieldSuffix>
</DateFieldGroup>
<!-- Portaled content keeps an auto-sized wrapper; the pinned example's
w-full fills the popover's positioning container — see the
.hv-date-range-picker__popover.w-full adapter in date-range-picker.css,
which maps it to the same viewport width as the upstream chain. -->
<DateRangePickerPopover class="flex w-full flex-col gap-3">
<!-- The baseline fills the viewport; reserve the popover's 12px
collision padding on both sides so its contents stay reachable. -->
<DateRangePickerPopover
class="flex w-[calc(100vw-24px)] flex-col gap-3"
>
<RangeCalendar aria-label="出行日期" class="w-full">
<RangeCalendarHeader>
<CalendarYearPickerTrigger>