aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable
diff options
context:
space:
mode:
authorSteven Luscher <jquerycla@steveluscher.com>2013-05-01 15:01:32 -0700
committerMike Sherov <mike.sherov@gmail.com>2013-06-19 18:07:38 -0400
commitfcd1cafac8afe3a947676ec018e844eeada5b9de (patch)
tree4dee58eb628ea32edb7f0ac6f22def8aba2d3d55 /tests/unit/draggable
parentbca3e058e89bf40806170149b8029dfe52644248 (diff)
downloadjquery-ui-fcd1cafac8afe3a947676ec018e844eeada5b9de.tar.gz
jquery-ui-fcd1cafac8afe3a947676ec018e844eeada5b9de.zip
Draggable: active element blurs when clicking on a draggable. Fixes #4261 - Draggable: Inputs do not blur when clicking on a draggable
Diffstat (limited to 'tests/unit/draggable')
-rw-r--r--tests/unit/draggable/draggable_core.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js
index 232ac6c17..69906b6a7 100644
--- a/tests/unit/draggable/draggable_core.js
+++ b/tests/unit/draggable/draggable_core.js
@@ -199,4 +199,20 @@ test( "#8399: A draggable should become the active element after you are finishe
strictEqual( document.activeElement, element.get( 0 ), "finishing moving a draggable anchor made it the active element" );
});
+asyncTest( "#4261: active element should blur when mousing down on a draggable", function() {
+ expect( 2 );
+
+ var textInput = $( "<input>" ).appendTo( "#qunit-fixture" ),
+ element = $( "#draggable1" ).draggable();
+
+ TestHelpers.onFocus( textInput, function() {
+ strictEqual( document.activeElement, textInput.get( 0 ), "ensure that a focussed text input is the active element before mousing down on a draggable" );
+
+ TestHelpers.draggable.move( element, 50, 50 );
+
+ notStrictEqual( document.activeElement, textInput.get( 0 ), "ensure the text input is no longer the active element after mousing down on a draggable" );
+ start();
+ });
+});
+
})( jQuery );