-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Decouple backdrop click and ESC press on mat-dialog #10190
Comments
The suggested approach for this is to set See #3460 and linked threads for more context. |
@willshowell thanks for your comment. I am aware that there are possible workarounds. For example, I wrote something like this: const dialogRef = this.dialog.open(MyDialogComponent, {
disableClose: true
});
dialogRef.keydownEvents()
.filter((e: KeyboardEvent) => e.code === 'Escape')
.take(1)
.subscribe(() => dialogRef.close()); But wouldn't it be nice to have it out of box? I believe it could be useful for many people. |
@salemdar the team (at least in the past) has held pretty strong to this. See #3460 (comment) for a better explanation than I can give. |
Yep, as per Will's comment, we don't really want to decouple these behaviors. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Feature request:
Both ESC and backdrop click closes an active dialog. This can be disabled at the moment, but only all together. These two behaviours should be decoupled.
What is the expected behavior?
MatDialogConfig
should have 2 extra properties:What is the use-case or motivation for changing an existing behavior?
So we can disable closing on backdrop click, but keep close on ESC press. It would be very helpful for inaccurate mouse users :).
The text was updated successfully, but these errors were encountered: