VERY SERIOUS BUG: Drop down not always on top
The drop down list of multi choice select is sometimes underneath components when it should always be on top. See attached screenshots (This was in iOS 8 Safari):

Having this same issue, no amount of z-index, position or display trickery seems to fix it.
For now I'm just listening to when the dropdown comes up and and down and showing/hiding the textboxes. It's the best work-around I've found so far - but it doesn't look good though.
For me, this was an issue with Velocity. It inlines a transform: translateY(0), and transform prevents z-index from applying to it.
I think the menu dropdown (the one with class Select-menu-outer) should always be appended as a child element in the body and positioned near the select input by some calculations. Otherwise if my select component is inside an element whose z-index is less than another sibling element, the dropdown would never be on top.
HubSpot's react-select-plus takes in dropdownComponent as a prop which solves the issue.
this does not solve my problem or maybe I missed something in the usage ?
I'm not clear on what react-select-plus expects for dropdownComponent - I can provide a div for example, with a fixed height or what not, but the options don't appear. I was expecting it to just be a wrapper element, with the menu inside, but is it expecting me to provide the render options in there as well? (i.e. it is a custom menu dropdown, not a wrapper), it's unclear....
@duanefields It looks like it should be of the form dropdownComponent={props => <div>{props.children}</div>} but @prateekjahead I don't see how it solves the issue since — looking at the source — this custom component is still rendered as a child of the Select component.
@dperetti @duanefields So what I did was that I used the Portal component from react-overlays library so that the dropdownComponent is not rendered as a child of Select component, something like:
const dropdownComponent = ({children}) => (
<Portal show rootClose={false}>
{children}
</Portal>
);
And used the prop menuContainerStyle to position it near/below the target element after making calculations in onOpen callback. Anyone know a better solution?
I was able to fix this issue by using menuRenderer and setting position fixed, top and width for the menu element, some of this code is from react-select itself and I'm using typescript:
private menuRenderer(props: ReactSelect.MenuRendererProps<any>):
ReactSelect.HandlerRendererResult {
const Option = (props as any).optionComponent;
const bodyRect = document.body.getBoundingClientRect();
const elementRect = (this.refs.reactSelect.wrapper as HTMLDivElement).getBoundingClientRect();
const options = props.options.map((option, i) => {
const isSelected = props.valueArray && props.valueArray.indexOf(option) > -1;
const isFocused = option === props.focusedOption;
const optionClass = classNames((props as any).optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled,
});
return (
<Option
className={optionClass}
instancePrefix={(props as any).instancePrefix}
isDisabled={option.disabled}
isFocused={isFocused}
isSelected={isSelected}
key={`option-${i}-${option[(props as any).valueKey]}`}
onFocus={(props as any).onFocus}
onSelect={(props as any).onSelect}
option={option}
optionIndex={i}
ref={ref => { (props as any).onOptionRef(ref, isFocused); }}>
{(props as any).optionRenderer(option, i)}
</Option>
);
});
return <div className="Select-menu-outer" style={{ position: 'fixed', top: elementRect.top - bodyRect.top + elementRect.height + 2 + 'px', width: elementRect.width - 2 + 'px' }}>
<div role="listbox" className="Select-menu" id="react-select-2--list">
{options}
</div>
</div>;
}
Why is this issue closed when it still is happening?
Adding
styles={{
menuPortal: base => ({
...base,
transform: 'translateZ(0)'
has fixed it for our case (elements which had transform: translateZ or translate3d set were shown above the dropdown). Or you can remove translateZ from those elements
After seeing the half dozen related issues, yet not finding a resolution, I have found one.
<Select
menuPortalTarget={document.body}
menuPosition={'fixed'}
/>
Add these two options to your Select component.
It appears to make us of the new React Portal feature.
Your solution @MenachemICTBIT partially fixed it for me. Before only the first two could be seen. This issue has been around for 4 years!
It still doesn't fully fix it

After seeing the half dozen related issues, yet not finding a resolution, I have found one.
<Select menuPortalTarget={document.body} menuPosition={'fixed'} />Add these two options to your Select component.
It appears to make us of the new React Portal feature.
and
menuPortal: (provided: any, state: any) => ({
...provided,
zIndex: '9999',
}),
it worked for me!
I m facing the same bug now, nothing is working. Tried almost all possible ways. menu menuportal and even css styles.
I m facing the same bug now, nothing is working. Tried almost all possible ways.
menumenuportaland even css styles.
same here.