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

Added stacking to Modal #2644

Closed
wants to merge 1 commit into from
Closed

Conversation

elebetsamer
Copy link

I've made two tweaks to Modal.

First, I've added a "modal-backdrop-transparent" class and it gets applied to modal backdrops if there is already a backdrop present in the dom. This makes the backdrop transparent, that way the site can still be seen under the modal.

Second, I've added stacking to Modal that send already opened modals behind the backdrop if another modal is opened. Then when the second (or third or fourth) modal is closed it brings the next layer lower Modals back in front of the backdrop.

While I don't know if my implementation is optimal, it is working. If anyone has any feedback, let me know.

The first Modal:
The first Modal

The second Modal:
The second Modal

The third Modal:
The third Modal

@mdo
Copy link
Member

mdo commented Mar 19, 2012

We won't do this—stacking modals is never a good experience. In the future, we should allow for swapping content of the same modal instance though, but unclear of how or when that will happen.

@mdo mdo closed this Mar 19, 2012
@jsitoe
Copy link

jsitoe commented Mar 22, 2012

How can i avoid the situation shown in the image???
How to block the processing so that no other modal is loaded while one is still open/active??

@elebetsamer
Copy link
Author

@markdotto I can understand the reason, but since the modal framework still allows you to open more than a single modal at a time, I still think there is a need for this. I also don't think that stacking modals is always a bad experience and sometimes think it is required.

Take a real world example from my site. The create folder button is already in a dialog, so I need a new dialog to actually handle the creation of the folder. Without the improved stacking that I implemented, it doesn't look very good, but with the stacking it would look much better. I don't think this use case is very rare or unreasonable.
Select a Folder
Create Folder

In any case I respect your stance, but if you can provide an alternative design choice for even my above example, I'd appreciate it.

@syphernl
Copy link

syphernl commented May 7, 2012

Even though it might not be a good experience, this is still something that has its advantages.
I'm facing the same problem, I've decided to auto-close the initial one but that might not always be desirable. I don't see what would be negative on this experience. What's the alternative? Closing and reopening the other one, once the other one is closed back to the other one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants