diff --git a/devtools/client/shared/components/SearchBox.js b/devtools/client/shared/components/SearchBox.js index b24e2171a364..7af6e0639290 100644 --- a/devtools/client/shared/components/SearchBox.js +++ b/devtools/client/shared/components/SearchBox.js @@ -161,11 +161,9 @@ class SearchBox extends PureComponent { switch (e.key) { case "ArrowDown": - e.preventDefault(); autocomplete.jumpBy(1); break; case "ArrowUp": - e.preventDefault(); autocomplete.jumpBy(-1); break; case "PageDown": diff --git a/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html b/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html index 110d5640c1e7..7bec93bc4666 100644 --- a/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html +++ b/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html @@ -39,13 +39,6 @@ window.onload = async function () { "Autocomplete items are rendered as expected"); } - function compareCursorPosition(initialElement) { - const initialPosition = initialElement.selectionStart; - return (element) => { - is(element.selectionStart, initialPosition, "Input cursor position is not changed"); - } - } - const React = browserRequire("devtools/client/shared/vendor/react"); const SearchBox = React.createFactory( browserRequire("devtools/client/shared/components/SearchBox") @@ -123,7 +116,6 @@ window.onload = async function () { async function testKeyEventsWithAutocomplete() { // Clear the initial input $(".devtools-searchinput").focus(); - const cursorPositionIsNotChanged = compareCursorPosition($(".devtools-searchinput")); // ArrowDown synthesizeKey("KEY_ArrowDown"); @@ -154,7 +146,6 @@ window.onload = async function () { "a5", "[abc]", ]); - cursorPositionIsNotChanged($(".devtools-searchinput")); // PageDown should take -5 places up synthesizeKey("KEY_PageUp"); @@ -168,7 +159,6 @@ window.onload = async function () { "a5", "abc", ]); - cursorPositionIsNotChanged($(".devtools-searchinput")); // PageDown should take +5 places down synthesizeKey("KEY_PageDown"); @@ -182,7 +172,6 @@ window.onload = async function () { "a5", "[abc]", ]); - cursorPositionIsNotChanged($(".devtools-searchinput")); // Home should take to the top of the list synthesizeKey("KEY_Home"); @@ -196,7 +185,6 @@ window.onload = async function () { "a5", "abc", ]); - cursorPositionIsNotChanged($(".devtools-searchinput")); // End should take to the bottom of the list synthesizeKey("KEY_End"); @@ -210,7 +198,6 @@ window.onload = async function () { "a5", "[abc]", ]); - cursorPositionIsNotChanged($(".devtools-searchinput")); // Key down in existing state should rollover to the top synthesizeKey("KEY_ArrowDown");