aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2014-08-17 14:38:05 -0400
committerMike Sherov <mike.sherov@gmail.com>2014-08-17 14:38:05 -0400
commit48ea2aadad11938cc5ddbd9a340c4ca1c997550d (patch)
treeba2b0803cdb0da3619f54e032ad1550aec11d727 /tests
parentd10440fe44c840dd5c69c4efb1c06d2636fa11c6 (diff)
downloadjquery-ui-48ea2aadad11938cc5ddbd9a340c4ca1c997550d.tar.gz
jquery-ui-48ea2aadad11938cc5ddbd9a340c4ca1c997550d.zip
Draggable: Ensure overflow:visible containments are correctly measured
Fixes #7016
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/draggable/draggable_options.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js
index 03a9bf355..1b7dc2b3b 100644
--- a/tests/unit/draggable/draggable_options.js
+++ b/tests/unit/draggable/draggable_options.js
@@ -374,6 +374,36 @@ test( "containment, account for border", function() {
"The draggable should be to the right of its parent's right border" );
});
+// http://bugs.jqueryui.com/ticket/7016
+// draggable can be pulled out of containment in Chrome and IE8
+test( "containment, element cant be pulled out of container", function() {
+ expect( 1 );
+
+ var offsetBefore,
+ parent = $( "<div>").css({ width: 200, height: 200 }).appendTo( "#qunit-fixture" ),
+ element = $( "#draggable1" ).appendTo( parent );
+
+ element
+ .css({
+ height: "5px",
+ width: "5px"
+ })
+ .draggable({ containment: "parent" })
+ .simulate( "drag", {
+ dx: 200,
+ dy: 200
+ });
+
+ offsetBefore = element.offset();
+
+ element.simulate( "drag", {
+ dx: 200,
+ dy: 200
+ });
+
+ deepEqual( element.offset(), offsetBefore, "The draggable should not move past bottom right edge" );
+});
+
test( "containment, default, switching after initialization", function() {
expect( 8 );