Skip to content

Commit

Permalink
feat: When user hits enter, autoclick on first item in list
Browse files Browse the repository at this point in the history
  • Loading branch information
tomershvueli committed Jul 15, 2021
1 parent b2da1d5 commit 17da451
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/macos/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function search() {
document.getElementById("commandInput").addEventListener("keydown", (e) => {
if (e.code === "Enter") {
e.preventDefault();

// User has clicked enter, let's autoclick the first item
document.querySelector('[tabindex="2"]').click();
}
});

Expand Down
3 changes: 3 additions & 0 deletions app/windowsNlinux/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ function search() {
document.getElementById("commandInput").addEventListener("keydown", (e) => {
if (e.code === "Enter") {
e.preventDefault();

// User has clicked enter, let's autoclick the first item
document.querySelector('[tabindex="2"]').click();
}
});

Expand Down

0 comments on commit 17da451

Please sign in to comment.