From 0b729235eb9251e06dbaec0004838f276403d914 Mon Sep 17 00:00:00 2001
From: Nate Sesti <sestinj@gmail.com>
Date: Thu, 15 Jun 2023 20:50:52 -0700
Subject: tab autocomplete for slash commands

---
 extension/react-app/src/components/ComboBox.tsx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'extension/react-app/src/components/ComboBox.tsx')

diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx
index ace0605e..2b140567 100644
--- a/extension/react-app/src/components/ComboBox.tsx
+++ b/extension/react-app/src/components/ComboBox.tsx
@@ -113,6 +113,9 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
               (event.nativeEvent as any).preventDownshiftDefault = true;
               if (props.onEnter) props.onEnter(event);
               setInputValue("");
+            } else if (event.key === "Tab" && items.length > 0) {
+              setInputValue(items[0].name);
+              event.preventDefault();
             }
           },
           ref: ref as any,
-- 
cgit v1.2.3-70-g09d2

