Skip to content

Commit 47e52de

Browse files
bug(Select): expose height and max height props for Menu content (#10075)
* bug(Select): expose height and max height props for Menu contnet * add isScrollable prop * Update packages/react-core/src/components/Select/Select.tsx Co-authored-by: Eric Olkowski <[email protected]> --------- Co-authored-by: Eric Olkowski <[email protected]>
1 parent 04f1cf7 commit 47e52de

File tree

1 file changed

+13
-1
lines changed
  • packages/react-core/src/components/Select

1 file changed

+13
-1
lines changed

packages/react-core/src/components/Select/Select.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ export interface SelectProps extends MenuProps, OUIAProps {
7070
role?: string;
7171
/** Additional properties to pass to the popper */
7272
popperProps?: SelectPopperProps;
73+
/** Height of the select menu */
74+
menuHeight?: string;
75+
/** Maximum height of select menu */
76+
maxMenuHeight?: string;
77+
/** Indicates if the select menu should be scrollable */
78+
isScrollable?: boolean;
7379
}
7480

7581
const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
@@ -87,6 +93,9 @@ const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
8793
zIndex = 9999,
8894
role = 'listbox',
8995
popperProps,
96+
menuHeight,
97+
maxMenuHeight,
98+
isScrollable,
9099
...props
91100
}: SelectProps & OUIAProps) => {
92101
const localMenuRef = React.useRef<HTMLDivElement>();
@@ -151,14 +160,17 @@ const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
151160
}}
152161
isPlain={isPlain}
153162
selected={selected}
163+
isScrollable={isScrollable}
154164
{...getOUIAProps(
155165
Select.displayName,
156166
props.ouiaId !== undefined ? props.ouiaId : getDefaultOUIAId(Select.displayName),
157167
props.ouiaSafe !== undefined ? props.ouiaSafe : true
158168
)}
159169
{...props}
160170
>
161-
<MenuContent>{children}</MenuContent>
171+
<MenuContent menuHeight={menuHeight} maxMenuHeight={maxMenuHeight}>
172+
{children}
173+
</MenuContent>
162174
</Menu>
163175
);
164176
return (

0 commit comments

Comments
 (0)