Skip to content

Commit 5c12787

Browse files
committed
Merge branch 'main' into edit-crag
2 parents 6805e1d + 07d1a6b commit 5c12787

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

src/app/sandbox/date-picker/page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ function DatePickerPage() {
1919
year: 2024,
2020
});
2121

22+
const [value3, setValue3] = useState<TDate>({
23+
day: 19,
24+
month: 5,
25+
year: 2024,
26+
});
27+
2228
return (
2329
<div>
2430
<div className="relative mx-auto mt-8 w-80">
@@ -33,6 +39,12 @@ function DatePickerPage() {
3339
<DatePicker value={value1} onChange={setValue1} />
3440
</div>
3541
</div>
42+
<div className="relative mx-auto mt-8 w-80">
43+
A second regular datepicker to test overflow
44+
<div className="mt-2">
45+
<DatePicker value={value3} onChange={setValue3} />
46+
</div>
47+
</div>
3648
</div>
3749
);
3850
}

src/components/ui/date-picker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ function DatePicker({
572572
<FocusTrap focusTrapOptions={{ allowOutsideClick: true }}>
573573
<div
574574
ref={calendarPaneRef}
575-
className="absolute mt-2 w-[256px] min-[400px]:w-[298px] rounded-lg border border-neutral-400 bg-white px-2 py-3"
575+
className="absolute z-50 mt-2 w-[256px] min-[400px]:w-[298px] rounded-lg border border-neutral-400 bg-white px-2 py-3"
576576
>
577577
<div className="flex justify-between">
578578
{/* month shuffler */}

src/components/ui/select.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,14 @@ function InnerListBox({
193193
<Description className="text-sm mt-1">{description}</Description>
194194
)}
195195

196-
<div
197-
className={`absolute z-10 pb-2 ${
198-
customTrigger
199-
? "w-auto whitespace-nowrap max-xs:fixed max-xs:left-4 max-xs:right-4"
200-
: "w-full"
201-
}`}
196+
<ListboxOptions
197+
anchor="bottom start"
198+
className={`${!customTrigger && "min-w-[var(--button-width)] "} [--anchor-gap:8px] [--anchor-padding:8px] overflow-hidden rounded-lg border border-neutral-400 bg-white focus-visible:outline-none focus-visible:ring focus-visible:ring-blue-100`}
202199
>
203-
<ListboxOptions className="mt-2 overflow-hidden rounded-lg border border-neutral-400 bg-white focus-visible:outline-none focus-visible:ring focus-visible:ring-blue-100">
204-
<div ref={listboxOptionsRef} className="max-h-80 overflow-auto">
205-
{children}
206-
</div>
207-
</ListboxOptions>
208-
</div>
200+
<div ref={listboxOptionsRef} className="max-h-80 overflow-auto">
201+
{children}
202+
</div>
203+
</ListboxOptions>
209204
</Field>
210205
);
211206
}

0 commit comments

Comments
 (0)