improve plugin hotkey support (#426)

This commit is contained in:
Dornfeld Capital
2023-04-10 22:41:29 -05:00
committed by GitHub
parent da7463e901
commit 60288ad20a
2 changed files with 56 additions and 6 deletions
+8 -1
View File
@@ -284,9 +284,16 @@ export const ChatInput = ({
</button>
{showPluginSelect && (
<div className="absolute left-0 bottom-14 bg-white dark:bg-[#343541]">
<div className="absolute left-0 bottom-14 rounded bg-white dark:bg-[#343541]">
<PluginSelect
plugin={plugin}
onKeyDown={(e: any) => {
if (e.key === 'Escape') {
e.preventDefault();
setShowPluginSelect(false);
textareaRef.current?.focus();
}
}}
onPluginChange={(plugin: Plugin) => {
setPlugin(plugin);
setShowPluginSelect(false);