From 17da45172ec69a59f083789387bd8b3f2e2ca7f6 Mon Sep 17 00:00:00 2001 From: Tomer Date: Thu, 15 Jul 2021 09:46:52 -0400 Subject: [PATCH] feat: When user hits enter, autoclick on first item in list --- app/macos/src/index.js | 3 +++ app/windowsNlinux/src/index.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/macos/src/index.js b/app/macos/src/index.js index d5e50c0..395772c 100644 --- a/app/macos/src/index.js +++ b/app/macos/src/index.js @@ -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(); } }); diff --git a/app/windowsNlinux/src/index.js b/app/windowsNlinux/src/index.js index ae42944..462c47a 100644 --- a/app/windowsNlinux/src/index.js +++ b/app/windowsNlinux/src/index.js @@ -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(); } });