Skip to content

MatDialogConfig.id does not work? #9496

Closed

Description

@goldenbull

Bug, feature request, or proposal:

Bug

What is the expected behavior?

As the doc:
id: string | ID for the dialog. If omitted, a unique one will be generated.

What is the current behavior?

the generated dialog has no ID attribute:
<mat-dialog-container class="mat-dialog-container ng-tns-c1-0 ng-trigger ng-trigger-slideDialog ng-star-inserted" tabindex="-1" role="dialog" style="transform: none; opacity: 1;">...</mat-dialog-container>

What are the steps to reproduce?

    const dialogRef = this.dialog.open(PopupFormComponent, {
      id: 'dlg000',
      height: 200,
      width: 300
    });

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

Angular 5.2.0, Material 5.1.0

Activity

  1. crisbeto commented on Jan 20, 2018

    @crisbeto
    Member

    The main purpose of the id was to be able to get a hold of an arbitrary MatDialogRef. That being said, as a side-effect of #9379 it'll be added to the dialog container.

  2. goldenbull commented on Jan 22, 2018

    @goldenbull
    Author

    I'm newbie of the web world, sorry for bothering you with my simple questions.
    If the id field will not exist in the generated HTML, what's the proper way to customize the <mat-dialog-container> element style? For example, to set the padding=0px instead of the default CSS setting.

  3. crisbeto commented on Jan 22, 2018

    @crisbeto
    Member

    You can pass in the panelClass option and use that class to target your dialog.

  4. angular-automatic-lock-bot commented on Sep 8, 2019

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

  5. locked and limited conversation to collaborators on Sep 8, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions