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

Select's dropdown menu covered by other components #1342

Open
vlaux opened this issue Oct 23, 2020 · 3 comments
Open

Select's dropdown menu covered by other components #1342

vlaux opened this issue Oct 23, 2020 · 3 comments

Comments

@vlaux
Copy link
Member

vlaux commented Oct 23, 2020

Describe the bug
In cases where the select's dropdown menu is shown over components with higher z-indexes, it can get hidden by this another component (see screenshot)

To Reproduce
Change the Single Select example
to

import NumericStepper from '../NumericStepper'

const options = [
  {
    value: 'first-option',
    label: 'First Option',
  },
  {
    value: 'second-option',
    label: 'Second Option',
  },
]

;<div>
  <Select
    label="Label"
    options={options}
    multi={false}
    onChange={values => {
      console.log(`[Select] Selected: ${JSON.stringify(values, null, 2)}`)
    }}
  />
  <NumericStepper />
</div>

Expected behavior
Select's dropdown menu always on top.

Screenshots
image
image

Additional context
Question: why was the z-index = 1 and 2 needed for the NumericStepper?
Anyway, we probably agree that the menu portal should be always over any other component.

@estacioneto
Copy link
Contributor

Nice issue, man!

Question: why was the z-index = 1 and 2 needed for the NumericStepper?

Incredible question and I really don't know why. Maybe we should look after the author.

Anyway, we probably agree that the menu portal should be always over any other component.

Maybe for most cases, but, for example, should not be over a modal component IMO.

@vlaux
Copy link
Member Author

vlaux commented Oct 23, 2020

Maybe for most cases, but, for example, should not be over a modal component IMO.

Makes sense, but I'm talking only about the dropdown menu. So, if a Select is under a modal, it will be closed anyway (clicking outside the dropdown for opening a modal, for instance, would automatically close it).

@estacioneto
Copy link
Contributor

Nice! I just thought the sentence was ambiguous because dropdowns that are outside the modal should not be over the overlay, of course. But I get your point :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants