#4511 ESCAPE key close ALL opened modal dialogs

97 views
Skip to first unread message

Jörn Zaefferer

unread,
May 11, 2009, 8:23:01 AM5/11/09
to jquery-ui-dev
Commented here: http://dev.jqueryui.com/ticket/4511#comment:2

The dialog itself binds keydown event to itself for closing the dialog
on ESC; in addition, the dialog overlay binds a keydown event to
document, without filtering to close only the active dialog.

There doesn't seem be a trivial way to detect multiple modal dialogs.
Maybe the right approach here is to prevent multiple modal dialogs in
the first place. If we allow two, we allow an unlimited amount, sure
to be causing performance issues, as each creates its own overlay.

What do you think?

Jörn

Paul Bakaus

unread,
May 11, 2009, 8:25:37 AM5/11/09
to jquery...@googlegroups.com
We should in no way limit the number of modal dialogs open. Escape
closing all opened dialogs is clearly a bug to me.
--
Paul Bakaus
UI Architect
--
http://paulbakaus.com
http://www.linkedin.com/in/paulbakaus

Richard D. Worth

unread,
May 11, 2009, 8:31:47 AM5/11/09
to jquery...@googlegroups.com
Maybe we need to figure out a way for each successive modal dialog to reuse the overlay already there? Multiple modal dialogs will always open in a stack, so you can take the overlay from the currently open modal, and give it back when you close.

- Richard

Scott González

unread,
May 11, 2009, 8:35:02 AM5/11/09
to jquery...@googlegroups.com
Closed as duplicate of #3539.

I don't think we should fix this until we have a separate plugin for the overlay.

Brant Burnett

unread,
May 11, 2009, 8:35:08 AM5/11/09
to jquery...@googlegroups.com
I can personally say that I use multiple modal dialog boxes in one of my sites.  Basically, it's a user-friendly error message, but it has a link to pull up error detail, which is done in a second modal dialog box.  This does have other problems, too, such as overlays doubling up, rather than the first overlay moving up to be between the first and second dialogs.

I feel like the solution might be to move the modal functionality, and have a common overlay that gets created with the first dialog and destroyed after the first dialog is closed.  Then each dialog can call the overlay and get control, which returns the correct z-index for the dialog and places the overlay directly underneath it.  The overlay can capture the ESC keystroke and trigger back to the dialog, and it would keep track of the currently active dialog using a stack as each one calls it.

Brant

Paul Bakaus

unread,
May 11, 2009, 8:38:21 AM5/11/09
to jquery...@googlegroups.com
-1

I *really* don't see the big issue here. The implementation to reuse an active overlay is
trivial, and we should do it if we can't finish a seperate overlay plugin for 1.8.

2009/5/11 Scott González <scott.g...@gmail.com>

Scott González

unread,
May 11, 2009, 9:31:20 AM5/11/09
to jquery...@googlegroups.com
On Mon, May 11, 2009 at 8:38 AM, Paul Bakaus <paul....@googlemail.com> wrote:
I *really* don't see the big issue here. The implementation to reuse an active overlay is
trivial, and we should do it if we can't finish a seperate overlay plugin for 1.8.

That's an functional design decision that has to be made.  As it stands that bug should not be fixed by forcing a single overlay.  The current design for modal dialogs is that every dialog has its own overlay.  I'm not saying we can't change that, but that decision must be made by the team and documented before it can be a valid fix for this bug.

Paul Bakaus

unread,
May 11, 2009, 9:32:53 AM5/11/09
to jquery...@googlegroups.com
Agreed.

2009/5/11 Scott González <scott.g...@gmail.com>

Todd Parker

unread,
May 11, 2009, 12:54:12 PM5/11/09
to jQuery UI Development
I agree that we should allow for unlimited stacking of modal windows
but the overlay screen is going to look odd doubled or tripled up.

When we open a dialog from an existing dialog like in Brant's
scenario, could we just disable the original dialog and place the new
dialog on top? That would give the original dialog a dimmed back
appearance without needing another overlay layer and would prevent
interaction with it. I think we're applying an opacity to a disabled
element via the CSS framework, so this *could* look a little funky if
you had a bunch of modal dialogs stacked on each other but it might
look cool.

On May 11, 9:32 am, Paul Bakaus <paul.bak...@googlemail.com> wrote:
> Agreed.
>
> 2009/5/11 Scott González <scott.gonza...@gmail.com>
Reply all
Reply to author
Forward
0 new messages