Skip to content

Commit

Permalink
fix(scroll-area): added conditional flex-1 (shadcn-ui#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoyDiego authored Sep 25, 2023
1 parent 4f8d768 commit 1f16cf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion apps/www/registry/default/ui/scroll-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ const ScrollBar = React.forwardRef<
)}
{...props}
>
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
<ScrollAreaPrimitive.ScrollAreaThumb
className={cn(
"relative rounded-full bg-border",
orientation === "vertical" && "flex-1"
)}
/>
</ScrollAreaPrimitive.ScrollAreaScrollbar>
))
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
Expand Down
7 changes: 6 additions & 1 deletion apps/www/registry/new-york/ui/scroll-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ const ScrollBar = React.forwardRef<
)}
{...props}
>
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
<ScrollAreaPrimitive.ScrollAreaThumb
className={cn(
"relative rounded-full bg-border",
orientation === "vertical" && "flex-1"
)}
/>
</ScrollAreaPrimitive.ScrollAreaScrollbar>
))
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
Expand Down

0 comments on commit 1f16cf4

Please sign in to comment.