material-components-web icon indicating copy to clipboard operation
material-components-web copied to clipboard

MDC-Select custom max-height is not handled correctly

Open drcampbell opened this issue 8 years ago • 7 comments

What MDC Web Version are you using?

0.31.0

What browser(s) is this bug affecting?

All

What OS are you using?

Mac OS X, Windows

What are the steps to reproduce the bug?

Create a select input Fill the select menu with 100 items or something reasonably large Set the mdc-menu class to a max-height of 400px Select a list item far down the list Open the menu Observe it doesn't open in the correct location

What is the expected behavior?

The menu opens over the select input.

What is the actual behavior?

The menu opens at the top of the page

Any other information you believe would be useful?

drcampbell avatar Feb 21 '18 17:02 drcampbell

Made a pull request for this: https://github.com/material-components/material-components-web/pull/2285

drcampbell avatar Feb 21 '18 17:02 drcampbell

@drcampbell thanks for creating the PR. I created a (Codepen)[https://codepen.io/moog16/pen/RQJoom] to reproduce your issue. I'm just wondering if you could check it out, and see if this is the correct setup?

moog16 avatar Feb 22 '18 06:02 moog16

@moog16 Hi Moog. I modified your Codepen to demonstrate the issue clearly by just adding a margin wrapper to the top of the input: Codepen

Selecting a fruit that is far down the list clearly illustrates it when you reopen the select.

drcampbell avatar Feb 22 '18 15:02 drcampbell

@drcampbell I'm seeing this happen. Is this issue you are referring to? I just want to make sure we are looking at the same issue.

screen shot 2018-02-22 at 13 28 36

moog16 avatar Feb 22 '18 21:02 moog16

@moog16 Yep, that's the issue alright!

drcampbell avatar Feb 23 '18 02:02 drcampbell

This is no longer an issue since we have moved to using only native select in #2462. Closing.

moog16 avatar Apr 02 '18 16:04 moog16

I landed here after searching for --mdc-menu-max-height. It does not look like that variable is working. Menu height is stuck at 120px somehow as it gets injected into the element. Fortunately I could workaround it using max-height !important. --mdc-menu-min-width is working fine though.

Slion avatar Feb 11 '22 11:02 Slion