Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/odd-kiwis-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/drawer': patch
---

Fix `scrollable` prop so overflow shadow does not ever render if `scrollable={false}`
5 changes: 2 additions & 3 deletions packages/drawer/src/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(
const { ref: interceptRef, inView: isInterceptInView } = useInView({
initialInView: true,
fallbackInView: true,
skip: !scrollable,
});

const showCloseButton = !!onClose;
Expand Down Expand Up @@ -282,7 +281,7 @@ export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(
</div>
<div
className={getChildrenContainerStyles({
hasShadowTop: !isInterceptInView,
hasShadowTop: scrollable && !isInterceptInView,
theme,
})}
>
Expand All @@ -296,7 +295,7 @@ export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(
data-testid={lgIds.scrollContainer}
>
{/* Empty span element used to track if children container has scrolled down */}
<span ref={interceptRef} />
{scrollable && <span ref={interceptRef} />}
{children}
</div>
) : (
Expand Down
Loading