aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2013-04-03 12:26:39 -0400
committerMike Sherov <mike.sherov@gmail.com>2013-04-03 12:26:39 -0400
commit49c7b7200ef944ffc93487e79e763dfe97b4ff4a (patch)
tree4ed188b4de87a6fde2e6f07da460be7370b128d6 /tests
parenta88d64514001867b908776e6bfcfac7f1011970d (diff)
downloadjquery-ui-49c7b7200ef944ffc93487e79e763dfe97b4ff4a.tar.gz
jquery-ui-49c7b7200ef944ffc93487e79e763dfe97b4ff4a.zip
Draggable: Don't cache parent offset if the parent position is fixed. Fixes #5009 - Draggable: scroll not working with parent's position fixed
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/draggable/draggable_core.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js
index 0d693e4ff..9ef18c4b2 100644
--- a/tests/unit/draggable/draggable_core.js
+++ b/tests/unit/draggable/draggable_core.js
@@ -129,4 +129,34 @@ test( "#6258: not following mouse when scrolled and using overflow-y: scroll", f
});
});
+test( "#5009: scroll not working with parent's position fixed", function() {
+ expect( 2 );
+
+ var startValue = 300,
+ element = $( "#draggable1" ).wrap( "<div id='wrapper' />" ).draggable({
+ drag: function() {
+ startValue += 100;
+ $( document ).scrollTop( startValue ).scrollLeft( startValue );
+ },
+ stop: function( event, ui ) {
+ equal( ui.position.left, 10, "left position is correct despite overflow on HTML" );
+ equal( ui.position.top, 10, "top position is correct despite overflow on HTML" );
+ $( document ).scrollTop( 0 ).scrollLeft( 0 );
+ }
+ }),
+ contentToForceScroll = $( "<div>" ).css({
+ height: "20000px",
+ width: "20000px"
+ });
+
+ $( "#qunit-fixture" ).append( contentToForceScroll );
+ $( "#wrapper" ).css( "position", "fixed" );
+
+ element.simulate( "drag", {
+ dx: 10,
+ dy: 10,
+ moves: 3
+ });
+});
+
})( jQuery );