Skip to content

Loading…

Dialog: Fix for issue #5466, Dialog canceling input events #546

Closed
wants to merge 1 commit into from

2 participants

@j2jensen

The modal dialog was incorrectly canceling events on inputs that were
inside the top-most dialog, just because they happened to have a z-index
that wasn't high enough. This fix will prevent it blocking inputs that
are part of a dialog that shows above the modal overlay.

@j2jensen j2jensen Fixed bug (http://bugs.jqueryui.com/ticket/5466)
The modal dialog was incorrectly canceling events on inputs that were
inside the top-most dialog, just because they happened to have a z-index
that wasn't high enough. This fix will prevent it blocking inputs that
are part of a dialog that shows above the modal overlay.
d12eaff
@jzaefferer jzaefferer referenced this pull request
Merged

Dialog Redesign #787

@jzaefferer
jQuery Foundation member

Don't need this anymore since 3829a37 landed.

@jzaefferer jzaefferer closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2011
  1. @j2jensen

    Fixed bug (http://bugs.jqueryui.com/ticket/5466)

    j2jensen committed
    The modal dialog was incorrectly canceling events on inputs that were
    inside the top-most dialog, just because they happened to have a z-index
    that wasn't high enough. This fix will prevent it blocking inputs that
    are part of a dialog that shows above the modal overlay.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 ui/jquery.ui.dialog.js
View
5 ui/jquery.ui.dialog.js
@@ -692,8 +692,11 @@ $.extend( $.ui.dialog.overlay, {
if ( $.ui.dialog.overlay.instances.length ) {
$( document ).bind( $.ui.dialog.overlay.events, function( event ) {
// stop events if the z-index of the target is < the z-index of the overlay
+ // and if they are not inside a dialog whose z-index is < that of the overlay
// we cannot return true when we don't want to cancel the event (#3523)
- if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) {
+ var maxZ = $.ui.dialog.overlay.maxZ;
+ var $target = $( event.target );
+ if ( $target.zIndex() < maxZ && $target.closest('.ui-dialog').zIndex() < maxZ ) {
return false;
}
});
Something went wrong with that request. Please try again.