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 = () => (
340
340
</ ActionMenu >
341
341
)
342
342
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
+
343
360
export const OnlyInactiveItems = ( ) => (
344
361
< ActionMenu >
345
362
< ActionMenu . Button inactive > Open menu</ ActionMenu . Button >
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ type StyledOverlayProps = {
17
17
maxHeight ?: keyof Omit < typeof heightMap , 'auto' | 'initial' >
18
18
maxWidth ?: keyof Omit < typeof widthMap , 'auto' >
19
19
visibility ?: 'visible' | 'hidden'
20
+ overflow ?: 'auto' | 'hidden' | 'scroll' | 'visible'
20
21
anchorSide ?: AnchorSide
21
22
} & SxProp
22
23
@@ -64,7 +65,7 @@ const StyledOverlay = styled.div<StyledOverlayProps>`
64
65
max-height: ${ props => props . maxHeight && heightMap [ props . maxHeight ] } ;
65
66
width: ${ props => widthMap [ props . width || 'auto' ] } ;
66
67
border-radius: 12px;
67
- overflow: hidden;
68
+ overflow: ${ props => ( props . overflow ? props . overflow : ' hidden' ) } ;
68
69
animation: overlay-appear ${ animationDuration } ms ${ get ( 'animation.easeOutCubic' ) } ;
69
70
70
71
@keyframes overlay-appear {
You can’t perform that action at this time.
0 commit comments