question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MdDialog width configuration uncenter dialog.

See original GitHub issue

Bug, feature request, or proposal:

Bug: MdDialog not centered when is open passing a configuration of a custom width.

What is the expected behavior?

MdDialog should be the size of the specified width but keep his center location.

What is the current behavior?

MdDialog is being moved to the left.

What are the steps to reproduce?

https://plnkr.co/edit/fvG6lS8VIihJUlfu01Bv?p=preview

openDialog() { this.dialog.open(DialogOverviewExampleDialog, { width: '600px' }); }

image

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

Material 2.0.0-beta.2 Chrome in Windows

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

16reactions
willshowellcommented, Jun 27, 2017

As another solution, you can add a panelClass to the dialog and then apply whatever css just to that specific dialog.

this.dialog.open(MyDialogComponent, {
  panelClass: 'my-full-screen-dialog',
  data: { ... }
});
.my-full-screen-dialog .mat-dialog-container {
  max-width: none;
  width: 100vw;
  height: 100vh;
}
6reactions
willshowellcommented, Jul 4, 2017

@julianobrasil the styles must be global or without view encapsulation 😁

https://plnkr.co/edit/lGFjGSmhlr9tOoHK1gJp?p=preview

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set up the max-width of $mdDialog? - Stack Overflow
To achieve what you want you should use this way: .md-dialog-content { max-width: 300px; }.
Read more >
Services > $mdDialog - AngularJS Material
$mdDialog opens a dialog over the app to inform users about critical information or require them to make decisions. There are two approaches...
Read more >
MdDialog not resizing height to contents on open · Issue #2351
trying to create an MdDialog using the Material 2 library. Expect the dialog to automatically size to the contents of the dialog.
Read more >
embedding widget in mdDialog - ServiceNow Community
We would like to embed a widget in a mdDialog modal box, and am wondering how to do it. ... <div class="md-dialog-container" id="scheduleAppts">....
Read more >
How do I configure a full height Angular Material Dialog that ...
I set a height & width to my popup using the below code. When I open my dialog, the bottom portion is cut...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found