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

fix(menu): Fixed maxHeight calculation for menu portal. #5716

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jul 30, 2023

  1. fix(menu): Fixed maxHeight calculation for menu portal.

    If the viewSpaceBelow is less than 300px (default max height):
    
    The first time the menu renders, the viewSpaceBelow will probably not be
    greater than the menuHeight. So it will take path 2. or 3. for
    bottom/auto. If the viewable area is greater than the minimum height
    then it will take path 3.
    On the next render, the menuHeight is now less than viewSpaceBelow
    because it was constrained by the third path. So the first path is
    taken, but preferredMaxHeight will be greater than viewSpaceBelow
    because path 3 was taken on the previous render. The menu renders but
    overflows outside the view.
    On the following render, path 1 is not taken because the height is
    greater than the viewSpaceBelow again (because its overflowing). So path
    3 is taken again.
    
    This resolves the potential for flickering by making sure that the size
    that _would_ be rendered will actually fit. But comparing the
    `viewSpaceBelow` and `scrollSpaceBelow` to the `maxHeight` that would
    actually be returned, not to the height of the menu currently.
    elliotcourant committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    e3c63c8 View commit details
    Browse the repository at this point in the history
  2. chore: Adding changeset

    elliotcourant committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    1b3571b View commit details
    Browse the repository at this point in the history