Skip to content

Commit

Permalink
Pressing return on a highlighted search result now correctly adds it …
Browse files Browse the repository at this point in the history
…to the recipe in Firefox.
  • Loading branch information
n1474335 committed Aug 19, 2018
1 parent f052ed9 commit 740f392
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/web/OperationsWaiter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class OperationsWaiter {
searchOperations(e) {
let ops, selected;

if (e.type === "search") { // Search
if (e.type === "search" || e.keyCode === 13) { // Search or Return
e.preventDefault();
ops = document.querySelectorAll("#search-results li");
if (ops.length) {
Expand All @@ -48,9 +48,7 @@ class OperationsWaiter {
}
}

if (e.keyCode === 13) { // Return
e.preventDefault();
} else if (e.keyCode === 40) { // Down
if (e.keyCode === 40) { // Down
e.preventDefault();
ops = document.querySelectorAll("#search-results li");
if (ops.length) {
Expand Down

0 comments on commit 740f392

Please sign in to comment.