diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2014-08-09 23:11:16 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-08-12 19:30:09 -0400 |
commit | bbf9ea0942622a40d1adafeaed7045e0cf6ff8fd (patch) | |
tree | 8cfb201071a15dd6ce66c33ee5d981786561a576 /tests | |
parent | be4c0fc3240fb945ed0311f82f6d2adf1b8f4dd0 (diff) | |
download | jquery-ui-bbf9ea0942622a40d1adafeaed7045e0cf6ff8fd.tar.gz jquery-ui-bbf9ea0942622a40d1adafeaed7045e0cf6ff8fd.zip |
Draggable: ignore overflow:hidden containers with scroll option
While it is true that overflow:hidden elements can be scrolled
programatically, this breaks user expectation. Therefore, do not
scroll inside an overflow:hidden container.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/draggable/draggable_options.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index a94452d9a..99fd608bf 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -878,6 +878,20 @@ test( "scroll, scrollSensitivity, and scrollSpeed", function() { TestHelpers.draggable.restoreScroll( document ); }); +test( "scroll ignores containers that are overflow: hidden", function() { + expect( 2 ); + + var element = $( "#draggable1" ).draggable({ scroll: true }).appendTo( "#scrollParent" ); + + element.simulate( "drag", { + dx: 1300, + dy: 1300 + }); + + equal( $( "#scrollParent" ).scrollTop(), 0, "container doesn't scroll vertically" ); + equal( $( "#scrollParent" ).scrollLeft(), 0, "container doesn't scroll horizontally" ); +}); + test( "#6817: auto scroll goes double distance when dragging", function() { expect( 2 ); |