diff options
Diffstat (limited to 'ui/widgets/draggable.js')
-rw-r--r-- | ui/widgets/draggable.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/widgets/draggable.js b/ui/widgets/draggable.js index 7da09b7ec..32bf861ed 100644 --- a/ui/widgets/draggable.js +++ b/ui/widgets/draggable.js @@ -143,14 +143,19 @@ $.widget( "ui.draggable", $.ui.mouse, { }, _blurActiveElement: function( event ) { - - // Only need to blur if the event occurred on the draggable itself, see #10527 - if ( !this.handleElement.is( event.target ) ) { + var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), + target = $( event.target ); + + // Only blur if the event occurred on an element that is: + // 1) within the draggable handle + // 2) but not within the currently focused element + // See #10527, #12472 + if ( this._getHandle( event ) && target.closest( activeElement ).length ) { return; } // Blur any element that currently has focus, see #4261 - $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) ); + $.ui.safeBlur( activeElement ); }, _mouseStart: function( event ) { |