diff options
author | Scott González <scott.gonzalez@gmail.com> | 2017-04-18 16:51:23 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2017-05-02 15:16:17 -0400 |
commit | 50efd6e1b063822c4a0ecb38f324ed3354f387c4 (patch) | |
tree | c7d0a0809f5a8dfa8ab744e58556f27e756d6fe5 /tests | |
parent | 7d992ae29d27cdab8787691a14e689e60c74c05c (diff) | |
download | jquery-ui-50efd6e1b063822c4a0ecb38f324ed3354f387c4.tar.gz jquery-ui-50efd6e1b063822c4a0ecb38f324ed3354f387c4.zip |
Menu: Ignore mouse events triggered due to page scrolling
Fixes #9356
Closes gh-1806
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/selectmenu/core.js | 4 | ||||
-rw-r--r-- | tests/unit/selectmenu/events.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/selectmenu/core.js b/tests/unit/selectmenu/core.js index cef6dc5bf..708452312 100644 --- a/tests/unit/selectmenu/core.js +++ b/tests/unit/selectmenu/core.js @@ -251,13 +251,13 @@ $.each( [ wrappers = menu.find( "li.ui-menu-item .ui-menu-item-wrapper" ); button.trigger( "click" ); - wrappers.first().simulate( "mouseover" ).trigger( "click" ); + wrappers.first().simulate( "mouseover", { clientX: 2, clientY: 2 } ).trigger( "click" ); assert.equal( element[ 0 ].selectedIndex, 0, "First item is selected" ); button.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); assert.equal( element[ 0 ].selectedIndex, 0, "No looping beyond first item" ); button.trigger( "click" ); - wrappers.last().simulate( "mouseover" ).trigger( "click" ); + wrappers.last().simulate( "mouseover", { clientX: 3, clientY: 3 } ).trigger( "click" ); assert.equal( element[ 0 ].selectedIndex, wrappers.length - 1, "Last item is selected" ); button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); assert.equal( element[ 0 ].selectedIndex, wrappers.length - 1, "No looping behind last item" ); diff --git a/tests/unit/selectmenu/events.js b/tests/unit/selectmenu/events.js index 4aed70ac8..ffc0429ee 100644 --- a/tests/unit/selectmenu/events.js +++ b/tests/unit/selectmenu/events.js @@ -89,9 +89,9 @@ QUnit.test( "focus", function( assert ) { button.trigger( "click" ); links = menu.find( "li.ui-menu-item" ); optionIndex = 0; - links.eq( optionIndex ).simulate( "mouseover" ); + links.eq( optionIndex ).simulate( "mouseover", { clientX: 2, clientY: 2 } ); optionIndex += 1; - links.eq( optionIndex ).simulate( "mouseover" ); + links.eq( optionIndex ).simulate( "mouseover", { clientX: 3, clientY: 3 } ); // This tests for unwanted, additional focus event on close that.element.selectmenu( "close" ); |