JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.44k stars 4.1k forks source link

Fix: Ensure menu is always in front of everything #5830

Open GuySartorelli opened 6 months ago

GuySartorelli commented 6 months ago

Fixes https://github.com/JedWatson/react-select/issues/5329

It's not uncommon for elements to have a z-index of >1, which would put them in front of the dropdown menu. There's no valid use case that I can think of where you'd actually want something to be in front of the dropdown menu, so the menu should have a really high z-index value to ensure it's on top of everything all the time.

In the unlikely event someone wants a specific element to be in front of the menu, they can either give that element a really high z-index, or change the z-index of menu for their specific use case - but we shouldn't have to customise the z-index to get the menu to display on top. The menu being on top should be the default behaviour.

changeset-bot[bot] commented 6 months ago

⚠️ No Changeset found

Latest commit: 7e23fd38217eae9bcfa363947beb2b499436ecea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codesandbox-ci[bot] commented 6 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7e23fd38217eae9bcfa363947beb2b499436ecea:

Sandbox Source
react-codesandboxer-example Configuration
GuySartorelli commented 6 months ago

Let me know if you want any tests, docs, etc - I didn't see a contribution guide so I just went with the least invasive change.