File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @primer/react ' : patch
3+ ---
4+
5+ Allow overflow scrolling to be controlled via an optional ` overflow ` property on Overlay
Original file line number Diff line number Diff line change @@ -340,6 +340,23 @@ export const OnRightSide = () => (
340340 </ ActionMenu >
341341)
342342
343+ export const SettingMaxHeight = ( ) => {
344+ return (
345+ < ActionMenu >
346+ < ActionMenu . Button > Open menu</ ActionMenu . Button >
347+ < ActionMenu . Overlay width = "auto" maxHeight = "large" overflow = "auto" >
348+ < ActionList >
349+ { Array . from ( { length : 100 } , ( _ , i ) => (
350+ < ActionList . Item key = { `item-${ i } ` } onSelect = { ( ) => alert ( `Item ${ i + 1 } clicked` ) } >
351+ Item { i + 1 }
352+ </ ActionList . Item >
353+ ) ) }
354+ </ ActionList >
355+ </ ActionMenu . Overlay >
356+ </ ActionMenu >
357+ )
358+ }
359+
343360export const OnlyInactiveItems = ( ) => (
344361 < ActionMenu >
345362 < ActionMenu . Button inactive > Open menu</ ActionMenu . Button >
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ type StyledOverlayProps = {
1717 maxHeight ?: keyof Omit < typeof heightMap , 'auto' | 'initial' >
1818 maxWidth ?: keyof Omit < typeof widthMap , 'auto' >
1919 visibility ?: 'visible' | 'hidden'
20+ overflow ?: 'auto' | 'hidden' | 'scroll' | 'visible'
2021 anchorSide ?: AnchorSide
2122} & SxProp
2223
@@ -64,7 +65,7 @@ const StyledOverlay = styled.div<StyledOverlayProps>`
6465 max-height: ${ props => props . maxHeight && heightMap [ props . maxHeight ] } ;
6566 width: ${ props => widthMap [ props . width || 'auto' ] } ;
6667 border-radius: 12px;
67- overflow: hidden;
68+ overflow: ${ props => ( props . overflow ? props . overflow : ' hidden' ) } ;
6869 animation: overlay-appear ${ animationDuration } ms ${ get ( 'animation.easeOutCubic' ) } ;
6970
7071 @keyframes overlay-appear {
You can’t perform that action at this time.
0 commit comments