Skip to content

Commit

Permalink
change precedence of fetchSearchResults, up/down/enter are more impor…
Browse files Browse the repository at this point in the history
…tant
  • Loading branch information
noway committed Nov 23, 2022
1 parent 0574b57 commit 2d5dbc9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions search.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@ function hookInput(node) {

node.addEventListener("keydown", function (e) {
// console.log("keydown", e.nativeEvent.which);
if (e.target.value.includes("from:")) {
fetchSearchResults(e.target.value);
}

console.log(e.key);
if (e.key === "Enter") {
Expand Down Expand Up @@ -387,6 +384,12 @@ function hookInput(node) {

}


else if (e.target.value.includes("from:")) {
fetchSearchResults(e.target.value);
return false
}

});

node.dataset.processed = true;
Expand Down

0 comments on commit 2d5dbc9

Please sign in to comment.