-
Notifications
You must be signed in to change notification settings - Fork 638
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
base: main
Are you sure you want to change the base?
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}`]: ''} : {})} | ||||||||||||||||||||||||||||||||||||||
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? 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 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?) 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
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. The dynamic data attribute generation using template literals could be error-prone if overlayProps contains unexpected values. Consider validating the overflow and maxHeight values against known valid options or using a mapping function to ensure only supported values are used.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||
<ActionListContainerContext.Provider | ||||||||||||||||||||||||||||||||||||||
value={{ | ||||||||||||||||||||||||||||||||||||||
container: 'ActionMenu', | ||||||||||||||||||||||||||||||||||||||
|
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.
Copilot uses AI. Check for mistakes.
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!