Skip to content

Dialog directives not functioning as expected when opening a dialog template with a set height #12138

Closed

Description

@dflo

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The elements inside a dialog template should be aligned/pinned correctly when a dialog is opened with a specified height.

  • An element decorated with the mat-dialog-title directive should be pinned to the top
  • An element decorated with the mat-dialog-actions directive should be pinned to the bottom

What is the current behavior?

  • A dialog is opened with two visible scroll bars

    one scrolls through title and content, other scrolls through content and actions

  • A dialog is opened with only one visible scroll bar, but behaves the same as the scenario above.
  • A dialog is opened with a single scroll bar and scrolls normally but the title and actions buttons are not pinned.
  • A dialog is opened that is taller than its content and the action buttons are not pinned to the bottom.

What are the steps to reproduce?

StackBlitz from Angular Material's Dialog documentation.

A dialog is opened with a template the uses the directives and sets a custom height 350px.

An edited StackBlitz to show a different scenario.

A dialog is opened with a template the uses the directives and sets a custom height that is bigger than the content.

What is the use-case or motivation for changing an existing behavior?

The existing behavior is not consistent and does not display the expected behavior described in the documentation.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

package version
angular 6.0.7
material/cdk 6.3.3
typescript 2.7.2
browsers version
Chrome 67.0.3396.99 (64-bit)
Firefox 61.0.1 (64-bit)

Is there anything else we should know?

Activity

  1. jelbourn commented on Jul 11, 2018

    @jelbourn
    Contributor

    It looks like that example has some issues, but the dialog directives are working as designed. They're intended to provide the styling for that region of the dialog, but don't "stick" to the top bottom so that developers have some flexibility about how they're placed.

    @crisbeto can you look at that example?

  2. crisbeto commented on Jul 12, 2018

    @crisbeto
    Member

    This has been an issue for a while. I have #9236 that should sort most of these out and allow us to make the buttons stick to the bottom.

  3. dflo commented on Jul 12, 2018

    @dflo
    Author

    @jelbourn I was under the impression that the directives would also "stick" the title to the top as described in the API docs and similar behavior would apply to the dialog actions.

    But I look forward to @crisbeto's changes going through.

  4. added
    needs triage
    on May 20, 2020
  5. added and removed
    needs triage
    on May 29, 2020
  6. removed their assignment
    on May 29, 2020
  7. devversion commented on Jul 14, 2020

    @devversion
    Member

    We need to re-audit this when we land our first MDC-based dialog prototype: #19038, #16254 (linking for later reference).

  8. added
    P4
    material spec
    on Jul 14, 2020
  9. amysorto commented on May 7, 2024

    @amysorto
    Contributor

    Verfied that is working correctly in the MDC dialog

  10. angular-automatic-lock-bot commented on Jun 7, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4area: material/dialogmaterial spec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions