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
Dropdown is getting overlapped by second react-select. #1537
Comments
anyone solved this problem? menuContainerStyle={{ zIndex: 5 }} not work. |
See prateekjahead's comment: #1010 |
By the way, zIndex doesn't has any effect on |
this worked for me
then I had to give fixed width to both the
|
v1.2.1
worked for me |
Any update on getting this resolved? |
@lounsbrough, this is worked for me: v2.4.2 |
@d3mp, yes, we implemented something like this and it's working in our environment. Thanks. |
@d3mp is right. You need to target the element that has the absolute style, which is the menu. |
@d3mp thanks, this works! Use it like:
|
worked for me |
Same here. Menu is still falling behind. |
@simonkaspersen @Jonny-B which version of Would you be able to create a codesandbox that replicates the behaviour? Would be easier to help if there's a code example in a codesandbox. Also, you can try portalling as suggested here — #3263 (comment) |
@flexdinesh Have tried with the 3 last versions. Will try. I am currently writing away some of the |
So I needed a combination of: menuPortalTarget={document.querySelector('body')} and: const selectStyles = {
menuPortal: base => ({ ...base, zIndex: 9999 }),
menu: provided => ({ ...provided, zIndex: "9999 !important" })
};
<Select
styles={selectStyles}
/> |
Default behaviour is correct, please see this CodeSandbox. |
After seeing the half dozen related issues, yet not finding a resolution, I have found one.
Add these two options to your Select component. It appears to make us of the new React Portal feature. |
Thanks @MenachemICTBIT I Was struggling with the same without finding any satisfactory solution, this worked like a charm! |
@jperestrelo Glad to hear it. I really struggled with this one as well. The next problem then becomes that, since the menu is |
I had a problem with a relative position of the Select component (fixed position was not an option), fixed it by creating a wrapper containing the status of open menu and updating the z-index based on state:
|
This solution worked for me. const selectStyles = { menu: styles => ({ ...styles, zIndex: 999 }) }; |
thank you. it works. |
It helped. Thanks |
This did not work for me. No change in behavior. |
try this const customStyles = { <Select |
hey guys mine is indside a model from headlessui below is my select component and modal code
} export default SearchableSelect;
|
The same issue: none of the solutions worked, and react select shows over the popup... |
This issue was still happening to me on "react-select": "^5.8.0", <SelectTimeInput
name="closesAt"
placeholder="Close time"
aria-label="close at time"
....
// menuPortalTarget is needed to avoid dropdown getting overlapped by second dropdown
// https://github.com/JedWatson/react-select/issues/1537
menuPortalTarget={document.body}
/> and solution for it was this: |
Hey guys, I have now been struggling for a few hours. I am having two react-select components.
The dropdown from the component on top is getting overlapped by the below component.
I added a z-index of 999 to .Select-menu-outer, but it doesn't change anything.
I have attached a screenshot of the issue.
The text was updated successfully, but these errors were encountered: