From c0651fec193bcea9a1764ca8435d7191c5d3980d Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sun, 3 Aug 2025 12:29:06 +0200 Subject: [PATCH] feat: replace scroll-area from radix with one that actually works and doesn't cause layout issues --- apps/web/src/app/globals.css | 2 +- apps/web/src/components/ui/scroll-area.tsx | 55 ++++------------------ 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index b25f2c1e..a6b86ae4 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -229,7 +229,7 @@ @utility scrollbar-thin { &::-webkit-scrollbar { - width: 8px; + width: 6px; height: 8px; } &::-webkit-scrollbar-track { diff --git a/apps/web/src/components/ui/scroll-area.tsx b/apps/web/src/components/ui/scroll-area.tsx index d5aaf2ee..1fc227b0 100644 --- a/apps/web/src/components/ui/scroll-area.tsx +++ b/apps/web/src/components/ui/scroll-area.tsx @@ -1,53 +1,18 @@ -"use client"; - import * as React from "react"; -import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"; - -import { cn } from "../../lib/utils"; +import { cn } from "@/lib/utils"; const ScrollArea = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - type?: "auto" | "always" | "scroll" | "hover"; - showHorizontalScrollbar?: boolean; - } ->(({ className, children, type, showHorizontalScrollbar, ...props }, ref) => ( - +>(({ className, children, ...props }, ref) => ( +
- - {children} - - - {showHorizontalScrollbar && } - - + {children} +
)); -ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName; +ScrollArea.displayName = "ScrollArea"; -const ScrollBar = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, orientation = "vertical", ...props }, ref) => ( - - - -)); -ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName; - -export { ScrollArea, ScrollBar }; +export { ScrollArea };