diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-15 20:50:52 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-15 20:50:52 -0700 |
commit | ccca93eb18ceac9769ebac380bca47f21a691d99 (patch) | |
tree | 55e44a2f95ca5137fcddb8dd1ec3aa89bbb4190d /extension/react-app/src | |
parent | f4664228b0d2a612f5c0cfb35062ae51d57e8a08 (diff) | |
download | sncontinue-ccca93eb18ceac9769ebac380bca47f21a691d99.tar.gz sncontinue-ccca93eb18ceac9769ebac380bca47f21a691d99.tar.bz2 sncontinue-ccca93eb18ceac9769ebac380bca47f21a691d99.zip |
tab autocomplete for slash commands
Diffstat (limited to 'extension/react-app/src')
-rw-r--r-- | extension/react-app/src/components/ComboBox.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
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, |