Skip to content

bug(Material 3 > Button): When button is last child element in mat-dialog-content it causes a vertical scrollbar to appear #29164

Open
@roesselman

Description

@roesselman

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

v17 (Material 2)

Description

When button is last child element in mat-dialog-content it causes a vertical scrollbar to appear.

Reproduction

StackBlitz link
Steps to reproduce:

  1. Create Angular v18 project + add Angular material v18
  2. Create a dialog component
  3. In dialog component: Add a mat-button in mat-dialog-content
  4. Open dialog

Screenshot 2024-05-31 154547

Expected Behavior

There should be no vertical scrollbar in the dialog

Actual Behavior

There is a vertical scroll bar in the dialog

Environment

  • Angular: "@angular/core": "18.0.0"
  • CDK/Material: "@angular/material": "18.0.0"
  • Browser(s): Edge
  • Operating System: Windows

Angular CLI: 18.0.0
Node: 22.2.0
Package Manager: npm 10.7.0
OS: win32 x64

Angular: 18.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, material-luxon-adapter
... platform-browser, platform-browser-dynamic, platform-server
... router

Package Version

@angular-devkit/architect 0.1800.0
@angular-devkit/build-angular 18.0.0
@angular-devkit/core 18.0.0
@angular-devkit/schematics 18.0.0
@schematics/angular 18.0.0
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/button

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions