mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Don't focus dialog when mousedown is on close button. Fixes #8838 - Dialog: Close icon does not work in dialog larger than the window in IE.
This commit is contained in:
parent
d179cbaf32
commit
60486ac632
11
ui/jquery.ui.dialog.js
vendored
11
ui/jquery.ui.dialog.js
vendored
@ -321,9 +321,14 @@ $.widget("ui.dialog", {
|
||||
.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
|
||||
.prependTo( this.uiDialog );
|
||||
this._on( this.uiDialogTitlebar, {
|
||||
mousedown: function() {
|
||||
// Dialog isn't getting focus when dragging (#8063)
|
||||
this.uiDialog.focus();
|
||||
mousedown: function( event ) {
|
||||
// Don't prevent click on close button (#8838)
|
||||
// Focusing a dialog that is partially scrolled out of view
|
||||
// causes the browser to scroll it into view, preventing the click event
|
||||
if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
|
||||
// Dialog isn't getting focus when dragging (#8063)
|
||||
this.uiDialog.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user