Skip to content

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

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

Closed
dflo opened this issue Jul 10, 2018 · 6 comments
Labels
area: material/dialog material spec Issue related to the Material Design spec https://material.io/design/ P4 A relatively minor issue that is not relevant to core functions

Comments

@dflo
Copy link

dflo commented Jul 10, 2018

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?

@jelbourn
Copy link
Member

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?

@crisbeto
Copy link
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.

@dflo
Copy link
Author

dflo commented Jul 12, 2018

@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.

@mmalerba mmalerba added the needs triage This issue needs to be triaged by the team label May 20, 2020
@crisbeto crisbeto added area: material/dialog Fixed in MDC and removed needs triage This issue needs to be triaged by the team labels May 29, 2020
@crisbeto crisbeto removed their assignment May 29, 2020
@devversion
Copy link
Member

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

@devversion devversion added P4 A relatively minor issue that is not relevant to core functions material spec Issue related to the Material Design spec https://material.io/design/ labels Jul 14, 2020
@amysorto
Copy link
Contributor

amysorto commented May 7, 2024

Verfied that is working correctly in the MDC dialog

@amysorto amysorto closed this as completed May 7, 2024
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/dialog material spec Issue related to the Material Design spec https://material.io/design/ P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

6 participants