From ab3e628badc6067a0939193685af65a1d7701aed Mon Sep 17 00:00:00 2001 From: ayxwi <274959179+xwil1@users.noreply.github.com> Date: Wed, 1 Jul 2026 11:57:17 +0800 Subject: [PATCH] Fix scroll bounds for long select dropdowns (#4798) Co-authored-by: Xvvln <180168103+Xvvln@users.noreply.github.com> --- src/components/ui/select.tsx | 2 +- tests/components/SelectContentScroll.test.ts | 29 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/components/SelectContentScroll.test.ts diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx index da9786805..42d8e6e0f 100644 --- a/src/components/ui/select.tsx +++ b/src/components/ui/select.tsx @@ -37,7 +37,7 @@ const SelectContent = React.forwardRef< { + const source = fs.readFileSync(SELECT_TSX, "utf8"); + + it("limits popper content to the available viewport height", () => { + expect(source).toContain("--radix-select-content-available-height"); + expect(source).toContain( + "max-h-[min(24rem,var(--radix-select-content-available-height))]", + ); + }); + + it("allows long option lists to scroll vertically", () => { + expect(source).toContain("overflow-y-auto"); + expect(source).toContain("overflow-x-hidden"); + }); +});