diff options
author | Steven Luscher <jquerycla@steveluscher.com> | 2013-05-02 12:07:34 -0700 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-06-19 08:38:57 -0400 |
commit | bca3e058e89bf40806170149b8029dfe52644248 (patch) | |
tree | 6a9795099c8798f47489c2a441de477a71536afa /tests/unit | |
parent | 91b7b9f9ab2e5baa31e37f34600457599409e161 (diff) | |
download | jquery-ui-bca3e058e89bf40806170149b8029dfe52644248.tar.gz jquery-ui-bca3e058e89bf40806170149b8029dfe52644248.zip |
Clicking on a draggable anchor without moving it should make it the active element (Fixes #8399).
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index e2dc2a481..232ac6c17 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -185,4 +185,18 @@ test( "#5727: draggable from iframe" , function() { TestHelpers.draggable.shouldMove( draggable1 ); }); +test( "#8399: A draggable should become the active element after you are finished interacting with it, but not before.", function() { + expect( 2 ); + + var element = $( "<a href='#'>link</a>" ).appendTo( "#qunit-fixture" ).draggable(); + + $( document ).one( "mousemove", function() { + notStrictEqual( document.activeElement, element.get( 0 ), "moving a draggable anchor did not make it the active element" ); + }); + + TestHelpers.draggable.move( element, 50, 50 ); + + strictEqual( document.activeElement, element.get( 0 ), "finishing moving a draggable anchor made it the active element" ); +}); + })( jQuery ); |