Skip to content
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

bug(Select): expose height and max height props for Menu content #10075

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/react-core/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export interface SelectProps extends MenuProps, OUIAProps {
role?: string;
/** Additional properties to pass to the popper */
popperProps?: SelectPopperProps;
/** Height of the menu */
menuHeight?: string;
/** Maximum height of menu */
maxMenuHeight?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also expose the isScrollable prop to pass to Menu, since that would have to be used when the actual menu height is greater than the menuHeight/maxMenuHeight props? It can be passed in fine, just isn't exposed in Select's prop table.

Also, I think it was mentioned maybe during the backlog meeting, but do we want to expose these props in Dropdown as well? Not a blocker here, but would be worth doing at some point

Copy link
Contributor Author

@tlabaj tlabaj Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. I can open a dropdown PR. I will add the additional prop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thatblindgeye technically they can spread the isScrollable, but i can add it so it is documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened follow up issue for dropdown #10083

}

const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
Expand All @@ -87,6 +91,8 @@ const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
zIndex = 9999,
role = 'listbox',
popperProps,
menuHeight,
maxMenuHeight,
...props
}: SelectProps & OUIAProps) => {
const localMenuRef = React.useRef<HTMLDivElement>();
Expand Down Expand Up @@ -158,7 +164,9 @@ const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
)}
{...props}
>
<MenuContent>{children}</MenuContent>
<MenuContent menuHeight={menuHeight} maxMenuHeight={maxMenuHeight}>
{children}
</MenuContent>
</Menu>
);
return (
Expand Down
Loading