Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dialog): prevent dialog from opening while another dialog is anim…
- Loading branch information
1 parent
b105039
commit 36f708c
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36f708c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
dialog.ts lines 119-124
This code change makes me to execute the following method before each MdDialog.open(...) to allow opening 'sub' dialogs:
((): void => this.dialog.openDialogs.forEach(x =>
(x)._containerInstance._isAnimating = false));
I am using Safari on MacOS.
For some reason the _isAnimating flag never becomes false. Maybe this is a bug.
Real world case: On a dialog there is a list of items. The items are each having a delete button that pop-ups a "Please confirm deleting..." dialog. Depending on the dialog result the delete operation is performed. With this change the delete operation is subscribing to the original dialog result and when I close the dialog containing the item list: the delete operation is executed (the user is never prompted to have a chance to cancel the operation). Probably my explanation isn't clear, but what matters is: returning a dialog reference belonging to another dialog is unfortunate. I recommend throwing an exception instead of returning the first '_isAnimating' dialog's reference.
36f708c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, if I have one dialog, and I want a another confirmation or other operation information, I can't open this new subdialog. Or then, the flag _isAnimating never change to false.