-
Notifications
You must be signed in to change notification settings - Fork 645
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 5 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 doesn’t contain scrollbars within its rounded border | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+25
to
+41
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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; | |
| max-height: var(--overlay-size-xsmall, 192px); | |
| } | |
| &:where([data-max-height-small]) { | |
| max-height: var(--overlay-size-small, 256px); | |
| } | |
| &:where([data-max-height-medium]) { | |
| max-height: var(--overlay-size-medium, 320px); | |
| } | |
| &:where([data-max-height-large]) { | |
| max-height: var(--overlay-size-large, 432px); | |
| } | |
| &:where([data-max-height-xlarge]) { | |
| max-height: var(--overlay-size-xlarge, 600px); |
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!
| 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
|
||||||||||||||||||||||||||||||||||||||
| {...(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; | |
| })() | |
| } |
Uh oh!
There was an error while loading. Please reload this page.