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
7 changes: 7 additions & 0 deletions .changeset/purple-pigs-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@primer/react": patch
---

Fix: ActionMenu with overflow contains scrollbars within its rounded border
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we should say what the new state is

for example:

Suggested change
Fix: ActionMenu with overflow contains scrollbars within its rounded border
ActionMenu: Scrollbars no longer overflow outside the menu's rounded border



42 changes: 42 additions & 0 deletions packages/react/src/ActionMenu/ActionMenu.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,46 @@
&:where([data-variant='fullscreen']) {
padding-top: var(--base-size-36);
}

/* Overflow variants */
&:where([data-overflow-auto]) {
overflow: auto;
}

&:where([data-overflow-hidden]) {
overflow: hidden;
}

&:where([data-overflow-scroll]) {
overflow: scroll;
}

&:where([data-overflow-visible]) {
overflow: visible;
}

/* Max-height size tokens (mirror Overlay sizes) */
&:where([data-max-height-xsmall]) {
max-height: 192px;
}

&:where([data-max-height-small]) {
max-height: 256px;
}

&:where([data-max-height-medium]) {
max-height: 320px;
}

&:where([data-max-height-large]) {
max-height: 432px;
}

&:where([data-max-height-xlarge]) {
max-height: 600px;
}

&:where([data-max-height-fit-content]) {
max-height: fit-content;
}
}
8 changes: 7 additions & 1 deletion packages/react/src/ActionMenu/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ const Overlay: FCWithSlotMarker<React.PropsWithChildren<MenuOverlayProps>> = ({
onPositionChange={onPositionChange}
variant={variant}
>
<div ref={containerRef} className={styles.ActionMenuContainer} data-variant={responsiveVariant}>
<div
ref={containerRef}
className={styles.ActionMenuContainer}
data-variant={responsiveVariant}
{...(overlayProps.overflow ? {[`data-overflow-${overlayProps.overflow}`]: ''} : {})}
{...(overlayProps.maxHeight ? {[`data-max-height-${overlayProps.maxHeight}`]: ''} : {})}
>
<ActionListContainerContext.Provider
value={{
container: 'ActionMenu',
Expand Down
Loading