-
Notifications
You must be signed in to change notification settings - Fork 647
Fix: ActionMenu with overflow doesn’t contain scrollbars within its rounded border #6978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0aab81d
5855566
34cc3b9
f28fad1
c81f4b4
4452cb7
38caacc
1c845f8
1edbe60
5769bb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@primer/react": patch | ||
| --- | ||
|
|
||
| Fix: ActionMenu with overflow contains scrollbars within its rounded border |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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}`]: ''} : {})} | ||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want a default value or not?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure :( Don't want to add unnecessary
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid, what's the default right now? Maybe we should keep that (is it auto?)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It came with no value(maybe default is |
||||||||||||||||||||||||||||||||||||||
| {...(overlayProps.maxHeight ? {[`data-max-height-${overlayProps.maxHeight}`]: ''} : {})} | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+323
to
+324
|
||||||||||||||||||||||||||||||||||||||
| {...(overlayProps.overflow ? {[`data-overflow-${overlayProps.overflow}`]: ''} : {})} | |
| {...(overlayProps.maxHeight ? {[`data-max-height-${overlayProps.maxHeight}`]: ''} : {})} | |
| { | |
| (() => { | |
| const allowedOverflows = ['auto', 'visible', 'hidden', 'scroll']; | |
| const allowedMaxHeights = ['small', 'medium', 'large']; | |
| const overflow = overlayProps.overflow; | |
| const maxHeight = overlayProps.maxHeight; | |
| const attrs: {[key: string]: string} = {}; | |
| if (overflow && allowedOverflows.includes(overflow)) { | |
| attrs[`data-overflow-${overflow}`] = ''; | |
| } | |
| if (maxHeight && allowedMaxHeights.includes(maxHeight)) { | |
| attrs[`data-max-height-${maxHeight}`] = ''; | |
| } | |
| return attrs; | |
| })() | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded pixel values for max-height create potential inconsistency with the design system. Consider using CSS custom properties or design tokens to ensure these values stay synchronized with the Overlay component's sizing system that this is mirroring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion!