Skip to content
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

Detect if DialogRef close has been called #16636

Closed
MikeMatusz opened this issue Jul 29, 2019 · 1 comment · Fixed by #16691
Closed

Detect if DialogRef close has been called #16636

MikeMatusz opened this issue Jul 29, 2019 · 1 comment · Fixed by #16691
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@MikeMatusz
Copy link

Feature Description

Provide a method/property on DialogRef to indicate the dialog is in a closing state (i.e. dialogRef.close() has been called). For example: dialogRef.isClosing() or dialogRef.state

Use Case

There is a small but non-negligible span of time between calling dialogRef.close() and the dialog actually being removed. It would be nice to be able to prevent certain user actions during this time, in a generic fashion. Currently, you either have to take another action every time you call close() (which doesn't account for calls coming from within the component, could be missed/isn't generic) or check the _state property of MatDialogContainer (which is an internal property of an internal class, so not something anyone should do). Having this state indicator would allow a single common component used on many dialogs to handle such a behavior.

@MikeMatusz MikeMatusz added the feature This issue represents a new feature or feature request rather than a bug or bug fix label Jul 29, 2019
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jul 31, 2019
@crisbeto crisbeto self-assigned this Aug 5, 2019
@crisbeto crisbeto added the has pr label Aug 5, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue Aug 5, 2019
Exposes whether the dialog is currently open, closed or closing. This is useful when writing components around our dialog.

Fixes angular#16636.
jelbourn pushed a commit that referenced this issue Aug 27, 2019
Exposes whether the dialog is currently open, closed or closing. This is useful when writing components around our dialog.

Fixes #16636.
mmalerba pushed a commit to mmalerba/components that referenced this issue Aug 27, 2019
Exposes whether the dialog is currently open, closed or closing. This is useful when writing components around our dialog.

Fixes angular#16636.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants