Skip to content

Commit

Permalink
chore(Dialog): renamed buttonType to type in mat-dialog-close
Browse files Browse the repository at this point in the history
  • Loading branch information
flauc authored and jelbourn committed Sep 6, 2019
1 parent fa0a6eb commit b65433f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/material/dialog/dialog-content-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ let dialogElementUid = 0;
host: {
'(click)': 'dialogRef.close(dialogResult)',
'[attr.aria-label]': 'ariaLabel || null',
'[attr.type]': 'buttonType',
'[attr.type]': 'type',
}
})
export class MatDialogClose implements OnInit, OnChanges {
/** Screenreader label for the button. */
@Input('aria-label') ariaLabel: string;

/** Default to "button" to prevents accidental form submits. */
@Input('type') buttonType: 'submit' | 'button' = 'button';
@Input() type: 'submit' | 'button' | 'reset' = 'button';

/** Dialog close input. */
@Input('mat-dialog-close') dialogResult: any;
Expand Down
1 change: 1 addition & 0 deletions src/material/dialog/dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,7 @@ class ContentElementDialog {}
aria-label="Best close button ever"
[mat-dialog-close]="true"></button>
<div mat-dialog-close>Should not close</div>
<button class="with-submit" type="submit" mat-dialog-close>Should have submit</button>
</mat-dialog-actions>
</ng-template>
`
Expand Down
1 change: 1 addition & 0 deletions tools/public_api_guard/material/dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export declare class MatDialogClose implements OnInit, OnChanges {
ariaLabel: string;
dialogRef: MatDialogRef<any>;
dialogResult: any;
type: 'submit' | 'button' | 'reset';
constructor(dialogRef: MatDialogRef<any>, _elementRef: ElementRef<HTMLElement>, _dialog: MatDialog);
ngOnChanges(changes: SimpleChanges): void;
ngOnInit(): void;
Expand Down

0 comments on commit b65433f

Please sign in to comment.