Skip to content

Commit

Permalink
fix(material/dialog): dialog actions overflow and are unreachable
Browse files Browse the repository at this point in the history
Fixes a bug in the Angular Material dialog component where
buttons/actions are unreachable due to dialog overflowing
because of unspecified max-height for the mat-dialog-container
parent flexbox.

Fixes #24785
  • Loading branch information
essjay05 committed May 2, 2024
1 parent 7136c20 commit 8bdb25b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/material/dialog/dialog.scss
Expand Up @@ -14,6 +14,9 @@ $mat-dialog-content-max-height: 65vh !default;
// Dialog button horizontal margin. This has been extracted from MDC as they
// don't expose this value as variable.
$mat-dialog-button-horizontal-margin: 8px !default;
// Dialog container max height. This has been given a default value so the
// flex-children can be calculated and not overflow on smaller screens.
$mat-dialog-container-max-height: 95vh !default;

// Whether to emit fallback values for the structural styles. Previously MDC was emitting
// paddings in the static styles which meant that users would get them even if they didn't
Expand Down Expand Up @@ -41,6 +44,8 @@ $_emit-fallbacks: true;
// The dialog container is focusable. We remove the default outline shown in browsers.
outline: 0;

max-height: $mat-dialog-container-max-height;

.mdc-dialog__container {
transition: opacity linear var(--mat-dialog-transition-duration, 0ms);
}
Expand Down

0 comments on commit 8bdb25b

Please sign in to comment.