@@ -24,7 +24,7 @@ import {ActionListContainerContext} from '../../ActionList/ActionListContainerCo
2424import { useSlots } from '../../hooks/useSlots'
2525import { useProvidedRefOrCreate , useId , useAnchoredPosition } from '../../hooks'
2626import { useFocusZone } from '../../hooks/useFocusZone'
27- import { StyledOverlay , OverlayProps } from '../../Overlay/Overlay'
27+ import { StyledOverlay , OverlayProps , heightMap } from '../../Overlay/Overlay'
2828import InputLabel from '../../internal/components/InputLabel'
2929import { invariant } from '../../utils/invariant'
3030
@@ -65,7 +65,8 @@ export type SelectPanelProps = {
6565
6666 // TODO: move these to SelectPanel.Overlay or overlayProps
6767 width ?: OverlayProps [ 'width' ]
68- height ?: OverlayProps [ 'height' ] | 'fit-content'
68+ height ?: 'fit-content' // not used, keeping it around temporary for backward compatibility
69+ maxHeight ?: Exclude < OverlayProps [ 'maxHeight' ] , 'xsmall' >
6970
7071 children : React . ReactNode
7172}
@@ -86,7 +87,7 @@ const Panel: React.FC<SelectPanelProps> = ({
8687 onSubmit : propsOnSubmit ,
8788
8889 width = 'medium' ,
89- height = 'large' ,
90+ maxHeight = 'large' ,
9091 ...props
9192} ) => {
9293 const [ internalOpen , setInternalOpen ] = React . useState ( defaultOpen )
@@ -229,8 +230,10 @@ const Panel: React.FC<SelectPanelProps> = ({
229230 aria-labelledby = { `${ panelId } --title` }
230231 aria-describedby = { description ? `${ panelId } --description` : undefined }
231232 width = { width }
232- height = { height }
233+ height = "fit-content"
234+ maxHeight = { maxHeight }
233235 sx = { {
236+ '--max-height' : heightMap [ maxHeight ] ,
234237 // reset dialog default styles
235238 border : 'none' ,
236239 padding : 0 ,
@@ -433,6 +436,7 @@ const SelectPanelFooter = ({...props}) => {
433436 display : 'flex' ,
434437 justifyContent : 'space-between' ,
435438 alignItems : 'center' ,
439+ flexShrink : 0 ,
436440 padding : hidePrimaryActions ? 2 : 3 ,
437441 minHeight : '44px' ,
438442 borderTop : '1px solid' ,
@@ -518,6 +522,8 @@ const SelectPanelLoading: React.FC<{children: string}> = ({children = 'Fetching
518522 alignItems : 'center' ,
519523 height : '100%' ,
520524 gap : 3 ,
525+ minHeight : 'min(calc(var(--max-height) - 150px), 324px)' ,
526+ // maxHeight of dialog - (header & footer)
521527 } }
522528 >
523529 < Spinner size = "medium" />
@@ -560,6 +566,8 @@ const SelectPanelMessage: React.FC<SelectPanelMessageProps> = ({
560566 paddingX : 4 ,
561567 textAlign : 'center' ,
562568 a : { color : 'inherit' , textDecoration : 'underline' } ,
569+ minHeight : 'min(calc(var(--max-height) - 150px), 324px)' ,
570+ // maxHeight of dialog - (header & footer)
563571 } }
564572 >
565573 { variant !== 'empty' ? (
0 commit comments