Skip to content

MatDialog - disableClose is dependent on hasBackdrop being true #11750

Closed
@marc-wilson

Description

@marc-wilson

Bug, feature request, or proposal:

Bug

What is the expected behavior?

MatDialogConfig disableClose should function like the documentation states:

disableClose: boolean | Whether the user can use escape or clicking outside to close a modal.

There is not mentioning of disableClose being dependent on hasBackdrop being true, but there is.

What is the current behavior?

disableClose should work whether or not hasBackdrop is true or false. Currently, the disableClose will only work if hasBackdrop is set to true. The documentation should either be updated to specify that disableClose is dependent on hasBackdrop or the bug should be fixed so that disableClose can be used regardless of the value of hasBackdrop.

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

https://stackblitz.com/edit/angular-ev6jqa?file=app/dialog-overview-example.ts

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

Quality

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

Angular 5 and 6

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

docsThis issue is related to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions