React-select: Hack: Showing dropdown on top of select input

Created on 30 Mar 2017  路  9Comments  路  Source: JedWatson/react-select

Saw some issues on this topic, but no activity or merged PRs. Here's a quick hack you can do to get the dropdown menu going in the up direction. Paste the following into your CSS file. Wrap your <Select /> component in a div with the select-up class included.

.select-up .Select-menu-outer {
    position: absolute !important;
    top: auto !important;
    bottom: calc(100% - 1px) !important;
    border-bottom-left-radius: 0px !important;
    border-bottom-right-radius: 0px !important;
    border-top-left-radius: 5px !important;
    border-top-right-radius: 5px !important;
}

.select-up .is-open .Select-control {
    border-top-right-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-right-radius: 5px !important;
    border-bottom-left-radius: 5px !important;
}

Example Usage:

<div className="select-up">
    <Select />
</div>

Preview:
screen shot 2017-03-30 at 12 31 58 pm

issuenhancement

Most helpful comment

add to
menuPlacement = "top"

Hi all,

It appears menuPlacement='top' solves this issue as per sandbox below, if this is incorrect, please let me know and I'll reopen and investigate, thank you.

Example - https://codesandbox.io/s/react-select-v3-sandbox-o0dfx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MalcolmDwyer picture MalcolmDwyer  路  3Comments

x-yuri picture x-yuri  路  3Comments

yrabinov picture yrabinov  路  3Comments

juliensnz picture juliensnz  路  3Comments

mjuopperi picture mjuopperi  路  3Comments