We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cae674 commit 324d3eaCopy full SHA for 324d3ea
ui/jquery.ui.dialog.js
@@ -702,6 +702,11 @@ $.extend($.ui.dialog.overlay, {
702
if (dialog.options.closeOnEscape && event.keyCode &&
703
event.keyCode === $.ui.keyCode.ESCAPE ) {
704
705
+ // find the 'top' overlay (by zIndex) and close its dialog
706
+ // Note: it's best to do this search here when we know we need it.
707
+ // Caching the top overlay at any point (like in dialog.moveToTop) is no better
708
+ // and if the dialog is closed my a mechanism other than the ESCAPE key on the overlay
709
+ // we would never use the cache.
710
$.grep(self.instances, function(instance){
711
return instance.zIndex() == $.ui.dialog.overlay.maxZ;
712
})[0].dialog.close(event);
0 commit comments