Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(lemon-ui): fix permanent scrollbar in ScrollableShadows (#66943)

okxint09fc383d872b
diff --git a/frontend/src/lib/components/ScrollableShadows/ScrollableShadows.tsx b/frontend/src/lib/components/ScrollableShadows/ScrollableShadows.tsx
index 3de7189a0e3e..fe5203cc0d04 100644
--- a/frontend/src/lib/components/ScrollableShadows/ScrollableShadows.tsx
+++ b/frontend/src/lib/components/ScrollableShadows/ScrollableShadows.tsx
@@ -78,10 +78,14 @@ export const ScrollableShadows = React.forwardRef<HTMLDivElement, ScrollableShad
? { overflow: 'hidden' }
: direction
? {
- overflowX: direction === 'horizontal' ? undefined : 'hidden',
- overflowY: direction === 'vertical' ? undefined : 'hidden',
+ // Base UI's ScrollArea.Viewport sets `overflow: scroll` as an inline
+ // style. Using `undefined` here lets that value win, which renders a
+ // permanent scrollbar even when content fits. `'auto'` overrides it so
+ // the scrollbar only appears when content actually overflows.
+ overflowX: direction === 'horizontal' ? 'auto' : 'hidden',
+ overflowY: direction === 'vertical' ? 'auto' : 'hidden',
}
- : undefined
+ : { overflowX: 'auto', overflowY: 'auto' }
}
>
<ScrollArea.Content className={clsx('min-w-0', contentClassName)}>{children}</ScrollArea.Content>