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 grouped <ListSubheader>'s are overlapping on top #23469

Closed
BernardA opened this issue Nov 10, 2020 · 3 comments
Closed

Select grouped <ListSubheader>'s are overlapping on top #23469

BernardA opened this issue Nov 10, 2020 · 3 comments
Labels
component: select This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@BernardA
Copy link

When limited by the height, scrolling the options will make each subheader remain on top even when all its sub-items have being scrolled up. Normally each subheader should be replaced by the next subheader.

  • [x ] The issue is present in the latest release.
  • [ x

] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Subheaders overlap
Screenshot 2020-11-10 at 14 50 34

Expected Behavior 🤔

They should not.

Steps to Reproduce 🕹

Steps:

  1. Go to https://codesandbox.io/s/material-demo-forked-xop0b
    2.Resize the browser height to force scroll
    3.Open the second select and scroll

Context 🔦

Your Environment 🌎

Current version as per sandbox

Tech Version
Material-UI 4
React
Browser
TypeScript
etc.
@BernardA BernardA added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 10, 2020
@brorlarsnicklas
Copy link
Contributor

brorlarsnicklas commented Nov 10, 2020

I might be wrong, but I think that this is not a problem with the material-ui components in general. It is just the way position sticky works.

Each of the "ListSubHeaders" have position: sticky and in order to get the behavior that I think you are expecting, you have to put your subheaders and their items inside a container. Adding e.g, a div around those will fix your problem.

image

@oliviertassinari oliviertassinari added component: select This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 10, 2020
@oliviertassinari
Copy link
Member

Duplicate of #18200

@oliviertassinari oliviertassinari marked this as a duplicate of #18200 Nov 10, 2020
@BernardA
Copy link
Author

@brorlarsnicklas, the codepen I linked to is forked from your select demo page. I only added a few lines to the options so that the issue is more clearly visible. So, it is indeed a problem with material-ui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants