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

Added menuPlacement prop to Dropdown component #561

Merged
Merged
Changes from all commits
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
7 changes: 7 additions & 0 deletions src/components/Dropdown/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const Dropdown = ({
ValueRenderer,
valueRenderer,
menuRenderer,
menuPlacement,
rtl,
size,
asyncOptions,
Expand Down Expand Up @@ -245,6 +246,7 @@ const Dropdown = ({
theme={customTheme}
maxMenuHeight={maxMenuHeight}
menuPortalTarget={menuPortalTarget}
menuPlacement={menuPlacement}
menuIsOpen={menuIsOpen}
tabIndex={tabIndex}
id={id}
Expand Down Expand Up @@ -272,6 +274,7 @@ Dropdown.defaultProps = {
onInputChange: NOOP,
searchable: true,
options: [],
menuPlacement: "bottom",
noOptionsMessage: NOOP,
clearable: true,
size: SIZES.MEDIUM,
Expand Down Expand Up @@ -361,6 +364,10 @@ Dropdown.propTypes = {
* custom menu render function
*/
menuRenderer: PropTypes.func,
/**
* Default placement of the Dropdown menu in relation to its control. Use "auto" to flip the menu when there isn't enough space below the control.
*/
menuPlacement: PropTypes.oneOf(["bottom", "top", "auto"]),
/**
* If set to true, the dropdown will be in Right to Left mode
*/
Expand Down