-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open multiple dialogs? #698
Comments
Currently you can only open one dialog at a time. According to the Material Design spec, whether multiple dialogs should be allowed depends on the context and type of dialog:
https://www.google.com/design/spec/components/dialogs.html#dialogs-content |
@marcysutton, @fhrtms - there have been discussions regarding extensions to $$interimService to cache a LIFO-stack of dialogs; where the hide() will pop off the most recent and hide/close that instance. |
@ThomasBurleson ahh! Apologies for prematurely closing. That sounds like similar behavior to the "escape stack" we discussed for Sidenav & Bottom Sheet. |
@marcysutton - exactly. After you indicated that the Spec loosely allows mulitple dialogs, I thought we should formally add the feature to Angular Material. |
@ThomasBurleson it says "[f]ull-screen dialogs may open additional dialogs, such as pickers, because their design accommodates additional layers". That leaves me with a few spec questions:
|
👍 for excellent questions. |
There's also the iOS style: if a popup opens while another is already open, it will temporarily hide the first popup, show the new popup until the user is done interacting with the new popup, then show the first popup again. |
👏 - I really like that idea also. Sounds like an option flag |
Consider $timeout() which returns a promise and the `$timeout.cancel( ) is used to cancels a task associated with the promise. Since $mdDialog.show() returns a promise, perhaps, |
Another use case?: |
Or you can use Toast components to show transient messages. |
I should have been more clear. By confirmation message, I mean a dialog with "OK", "Cancel" options. Toast messages aren't obvious enough for this purpose, but I do use them to show e.g. a successful save message. |
I'm found a nice way to use one dialog with back reference to the parent.
|
Thanks for sharing. What tool do you use to capture those gifs?
|
I like this one on Windows: No install, very handy and easy to use! and this on Linux: |
@fhrtms thanks for that code! It took me a while to figure out what you were doing since there were no english comments but it seems you are just saving the main dialog's scope before opening the second dialog, and then if the user cancels this second one, you just reopen the main with the old scope, is that right? |
@marcosportugal: Yes, this is what i do. |
I really need nested dialogs for our application, so i tinkered with the source code. I didn't test it very well but i think its working, at least for us. Its a quick solution (manipulating the z-index like i do is not very nice, i guess). If a new dialog opens, old dialogs won't close. If $mdDialog.cancel() is called the most recent dialog will be closed. hayloft@2ad189a Updated for 0.8.3: hayloft@1650734 |
Has anyone from core team been able to try out @benn0r's code? The change seems easy to digest. |
+1 |
+1.
Assume: If the original dialog is scrollable, and the trigger for the new dialog is somewhere inside the scrollable container. |
+1 |
I would be really glad to have this issue fixed. |
+1 |
1 similar comment
+1 |
Locking this issue until it becomes active, in-progress. |
any update on this @ThomasBurleson? |
I would like to open multiple layered dialogs from each controller. Is this possible?
Currently if i open a second dialog, the first one closes automatically.
The text was updated successfully, but these errors were encountered: