aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2014-08-16 09:44:05 -0400
committerMike Sherov <mike.sherov@gmail.com>2014-08-17 14:13:20 -0400
commitd10440fe44c840dd5c69c4efb1c06d2636fa11c6 (patch)
tree5edee39d36d1c1566b69553da6083b9298738b5a /tests/unit/draggable
parent075421d6d965c66055e47cde477f0ce2e23f1755 (diff)
downloadjquery-ui-d10440fe44c840dd5c69c4efb1c06d2636fa11c6.tar.gz
jquery-ui-d10440fe44c840dd5c69c4efb1c06d2636fa11c6.zip
Draggable: Only focus the draggable if the event occurs on a handle
Refs #10527
Diffstat (limited to 'tests/unit/draggable')
-rw-r--r--tests/unit/draggable/draggable_core.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js
index 93c6e4080..3e8e7e0f5 100644
--- a/tests/unit/draggable/draggable_core.js
+++ b/tests/unit/draggable/draggable_core.js
@@ -262,18 +262,26 @@ 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 );
+asyncTest( "blur behavior", function() {
+ expect( 3 );
+
+ var element = $( "#draggable1" ).draggable(),
+ focusElement = $( "<div tabindex='1'></div>" ).appendTo( element );
+
+ TestHelpers.onFocus( focusElement, function() {
+ strictEqual( document.activeElement, focusElement.get( 0 ), "test element is focused before mousing down on a draggable" );
- var textInput = $( "<input>" ).appendTo( "#qunit-fixture" ),
- element = $( "#draggable1" ).draggable();
+ TestHelpers.draggable.move( focusElement, 1, 1 );
- 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" );
+ // http://bugs.jqueryui.com/ticket/10527
+ // Draggable: Can't select option in modal dialog (IE8)
+ strictEqual( document.activeElement, focusElement.get( 0 ), "test element is focused after mousing down on itself" );
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" );
+ // http://bugs.jqueryui.com/ticket/4261
+ // active element should blur when mousing down on a draggable
+ notStrictEqual( document.activeElement, focusElement.get( 0 ), "test element is no longer focused after mousing down on a draggable" );
start();
});
});