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.

Full screen or full width of Dialog?

See original GitHub issue

Bug, feature request, or proposal:

I would like to have the dialog has full width of the screen. I may want full screen in some scenarios.

What is the expected behavior?

Full width.

What is the current behavior?

With such codes:

  openDialog() {
    let dialogRef = this.dialog.open(DialogResultExampleDialog, {width: window.innerWidth+'px'});
    dialogRef.afterClosed().subscribe(result => {
      this.selectedOption = result;
    });
  }

The dialog expands to the left edge of the screen, but there’s still large space between the right border and the right edge.

What are the steps to reproduce?

In https://material.angular.io/components/dialog/examples, and click Edit in Plunker, then copy/paste above codes, particularly with {width: window.innerWidth+'px'} or {width: '100%'}

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

Small mobile screen

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

Past versions and the latest:

  "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/flex-layout": "^2.0.0-rc.1",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/material": "^2.0.0-beta.7",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/platform-server": "^4.2.4",
    "@angular/router": "^4.2.4",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.25",
    "@types/core-js": "^0.9.42",
    "@types/jasmine": "^2.5.53",
    "@types/node": "^6.0.77",
    "@types/selenium-webdriver": "^2.53.42",
    "angular-in-memory-web-api": "^0.2.5",
    "concurrently": "^3.5.0",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "jasmine-core": "^2.6.4",
    "karma": "^1.7.0",
    "karma-chrome-launcher": "^2.2.0",
    "moment": "^2.18.1",
    "reflect-metadata": "^0.1.10",
    "rimraf": "^2.6.1",
    "rxjs": "^5.4.1",
    "systemjs": "^0.19.47",
    "typescript": "^2.4.1",
    "zone.js": "^0.8.10"
  },

Is there anything else we should know?

It might be even better to have full, fullWidth, fullHeight in MdDialogConfig.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
willshowellcommented, Jun 29, 2017

Dupe of https://github.com/angular/material2/issues/3239

Also you can use panelClass for adding whatever css you want.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make dialog width to the full screen - android - Stack Overflow
I am trying to expend the dialog width to full screen. Dialog Layout: <?xml version="1.0" encoding="utf-8"?> <android.
Read more >
Force dialog to take up full screen width « Learn Android The ...
So I ran into a problem with getting dialogs to take up the full screen. The resource view I was using already specified...
Read more >
Solved: full size the Dialog fields in full screen
hi,. i am working on aem 6.5 touch ui. my requirement is to maximize the width of the dialog fields when dialog is...
Read more >
Mat Dialog Full Width - StackBlitz
angular material dialog rwd full-width. ... const dialogRef = this.dialog.open. (ConfirmationDialog, { ... width: '100%',. panelClass: 'full-screen-modal'.
Read more >
Show in Full Screen (Only Width is full to the edge of screen ...
As per documentation said that you can achieved full screen dialog by sending true value to Show Method, but only width of dialog...
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