question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

menuPlacement="auto" does not respect maxMenuHeight property

See original GitHub issue

When menuPlacement="auto" is set and the menu is flipped (moved to the top of the select) the maxMenuHeight property is not respected and the menu is huge.

Here is a sandbox with the issue https://codesandbox.io/s/o7mrlm6z15

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ebonowcommented, Apr 28, 2021

Thank you @amitava82 This is a known issue as there is several similar issues related to or duplicated by this behavior that will be prioritized following the ongoing TypeScript refactoring.

2reactions
Mihaela-Maccommented, Feb 11, 2019

Strange. It works for me and I use both menu portal and menu placement auto. Eg.

const menuPortalTarget = document.getElementById('root');
<Select
          maxMenuHeight={220}
          menuPlacement="auto"
          menuPortalTarget={menuPortalTarget}
/>

@dep if you still have the max-height property I think you should remove it. At least for me it was causing some flickerish effect when the dropdown was at the bottom of the page (that happened with the previous version though).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to place React Select Menu - css - Stack Overflow
I tried menuPlacement = "auto" prop as you can see because from what I've seen in the documentation, it should do the positioning...
Read more >
max-height - CSS: Cascading Style Sheets - MDN Web Docs
The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger ......
Read more >
API - React Select
Even when commonProps are not listed in the prop types below, a custom component will ... Maximum height of the menu before scrolling....
Read more >
Help with React Select Menu : r/reactjs - Reddit
So page-wrapper 's height is supposed to emulate a page that has some content on it, hence the height CSS property. I placed...
Read more >
Understanding min-content, max-content, and fit-content in CSS
Understanding the CSS sizing properties is necessary for developers ... often used for webpage layouts, they are not always a perfect fit.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found