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

Setting maxHeight on overlay with flexibleConnectedTo strategy does not work, when viewport margin is also configured #17567

Open
alexbjorlig opened this issue Nov 1, 2019 · 2 comments
Labels
area: cdk/overlay P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@alexbjorlig
Copy link

alexbjorlig commented Nov 1, 2019

Reproduction

Steps to reproduce:

  1. Visit the stackblitz
  2. Click the 2 buttons

Expected Behavior

That the max height of 300px is respected in both cases

Actual Behavior

Max height is only respected, if withViewportMargin(10) is not configured.

Environment

  • Angular: 8.2.13
  • CDK/Material: 8.2.3
  • Browser(s): Version 78.0.3904.70 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS Mojave

Gif

bug-2

Relevant code

const overlayRef = this.overlay.create({
      hasBackdrop: true,
      positionStrategy: this.overlay.position().flexibleConnectedTo(element)

      // The max height is only respected, if the viewport margin is left out
      .withViewportMargin(10) // <------

      .withPositions([
        {
          originX: 'end',
          originY: 'bottom',
          overlayX: 'end',
          overlayY: 'top',
        },
      ]),
      width: '200px',
      maxHeight: '300px',
    });
@alexbjorlig alexbjorlig changed the title Setting maxHeight on overlay with flexibleConnectedTo strategy does not work, when viewport margin is also configured Setting maxHeight on overlay with flexibleConnectedTo strategy does not work Nov 1, 2019
@alexbjorlig alexbjorlig changed the title Setting maxHeight on overlay with flexibleConnectedTo strategy does not work Setting maxHeight on overlay with flexibleConnectedTo strategy does not work, when viewport margin is also configured Nov 1, 2019
@mmalerba mmalerba added the needs triage This issue needs to be triaged by the team label May 20, 2020
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Jul 16, 2020
@jelbourn
Copy link
Member

Confirmed this issue- maxHeight and maxWidth are just straight up not being set when isPushed gets set. Should be a relatively straightforward fix to always set these

@mackelito
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/overlay P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

6 participants