#8063 closed bug (fixed)
Escape closes incorrect dialog
Reported by: | tomblench | Owned by: | dalekocian |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.1 |
Component: | ui.dialog | Version: | 1.8.17 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
See http://jsfiddle.net/Wa5zW/
Expected behaviour: topmost dialog is closed when escape is pressed
Actual behaviour: only dialog 2 is closed (last dialog created)
More information: In the presence of multiple dialogs, escape should close the topmost dialog. In the jsfiddle above, if dialog 1 is focussed and dragged over the top of dialog 2, the user would expect dialog 1 to be closed by hitting escape, as it is the topmost dialog.
Additionally, once dialog 2 is closed, dialog 1 is never closed by hitting escape.
Relationship to other bugs: either this feature should work properly or should be dropped. Considering that a feature request for shortcut keys in dialogs (http://bugs.jqueryui.com/ticket/7472) was rejected, why does "escape" get supported as a special case (which is broken anwyay)?
Change History (9)
comment:1 Changed 11 years ago by
Status: | new → open |
---|
comment:2 Changed 11 years ago by
Thanks for the feedback.
If I click on Dialog 1 and hit escape, it does indeed close. However, hitting escape again does not cause Dialog 2 to close. Dialog 2 will only close if it is clicked on.
It's a bit of a dangerous thing to second-guess users' expectations, but I think it would be reasonable for the next dialog in the z-order to be focused once the top dialog is closed.
I understand this might seem like an obscure corner case, but jQuery UI allows multiple dialogs to be open, so they should be handled correctly. Also, it's reasonable for an application to have 2 or more dialogs open, such as a warning dialog which pops up on top of a dialog which is used to fill in preferences, etc.
comment:3 Changed 11 years ago by
Yes, it's definitely reasonable to have multiple dialogs open. We should be doing whatever native desktop dialogs do. Focus should probably jump to whatever element was previously focused.
comment:4 Changed 10 years ago by
Milestone: | 1.9.0 → 1.10.0 |
---|
comment:5 Changed 10 years ago by
Owner: | set to dalekocian |
---|---|
Status: | open → assigned |
comment:6 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:7 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:8 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Dialog: Added mousedown event handler on dialog title to focus. Fixed #8063 - Dialog: Escape closes incorrect dialog.
Changeset: 1a696678878f48748912b4c9d5df6da91c760b98
comment:9 Changed 10 years ago by
Milestone: | 1.10.0 → 1.9.1 |
---|
This is a bug in the drag behavior. When you drag dialog 1, the dialog is not getting focused. This likely happens because draggable calls event.preventDefault() in mousedown. Click anywhere else in dialog 1 and you'll see it working correctly.