Skip to content
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

MdDialogConfig Width Misaligned #3396

Closed
LilSebastian5000 opened this issue Mar 2, 2017 · 2 comments
Closed

MdDialogConfig Width Misaligned #3396

LilSebastian5000 opened this issue Mar 2, 2017 · 2 comments

Comments

@LilSebastian5000
Copy link

LilSebastian5000 commented Mar 2, 2017

Bug, feature request, or proposal:

MdDialogConfig width should apply to md-dialog-container, rather than a div with id 'cdk-overlay-4'. Otherwise, it will not center on the screen.

What is the expected behavior?

Setting a width in MdDialogConfig should still center the dialog in the browser

What is the current behavior?

When applying a width of '900px' to my MdDialogConfig on open(), the dialog floats to the left of the screen. If the width of 900px were to be applied to the 'md-dialog-container', instead of 'cdk-overlay-4', then the issue goes away, and everything looks as expected.

However, setting CSS on 'md-dialog-container' or '.mat-dialog-container' does not apply, since the dialog generates on a button click.

What are the steps to reproduce?

  1. TypeScript
let config:MdDialogConfig = {
               width: '900px'
            }

            self.dialog= this.dialog.open(DialogComponent, config);
            });
  1. HTML Template
<div>
    <h4>Show Result</h4>
    <md-dialog-content>
        /*content goes here*/
    </md-dialog-content>
    <md-dialog-actions>
        <button md-raised-button (click)="dialogRef.close()">Ok</button>
    </md-dialog-actions>
</div>

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

Consistent centering of dialogs

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

Angular 2.3.1, Material 2.0.0-beta.2

Is there anything else we should know?

This was not an issue in material 2.0.0-alpha.11-3

@crisbeto
Copy link
Member

crisbeto commented Mar 2, 2017

Closing as a duplicate of #3239.

@crisbeto crisbeto closed this as completed Mar 2, 2017
@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 Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants