summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components/TextDialog.tsx
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-16 16:25:02 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-16 16:25:02 -0700
commit4c3a25a1c8938f8132233e021c74d98eb19d7ddd (patch)
tree8460e5703f224e7ef5c2c7eca6b470f338b93e1e /extension/react-app/src/components/TextDialog.tsx
parent3ded151331933c9a1352cc46c3cc67c5733d1c86 (diff)
parenta4a815628f702af806603015ec6805edd151328b (diff)
downloadsncontinue-4c3a25a1c8938f8132233e021c74d98eb19d7ddd.tar.gz
sncontinue-4c3a25a1c8938f8132233e021c74d98eb19d7ddd.tar.bz2
sncontinue-4c3a25a1c8938f8132233e021c74d98eb19d7ddd.zip
Merge branch 'main' into ggml-server
Diffstat (limited to 'extension/react-app/src/components/TextDialog.tsx')
-rw-r--r--extension/react-app/src/components/TextDialog.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/extension/react-app/src/components/TextDialog.tsx b/extension/react-app/src/components/TextDialog.tsx
index ea5727f0..646d6846 100644
--- a/extension/react-app/src/components/TextDialog.tsx
+++ b/extension/react-app/src/components/TextDialog.tsx
@@ -2,6 +2,7 @@
import React, { useEffect, useState } from "react";
import styled from "styled-components";
import { Button, buttonColor, secondaryDark, vscBackground } from ".";
+import { isMetaEquivalentKeyPressed } from "../util";
const ScreenCover = styled.div`
position: absolute;
@@ -81,7 +82,11 @@ const TextDialog = (props: {
rows={10}
ref={textAreaRef}
onKeyDown={(e) => {
- if (e.key === "Enter" && e.metaKey && textAreaRef.current) {
+ if (
+ e.key === "Enter" &&
+ isMetaEquivalentKeyPressed(e) &&
+ textAreaRef.current
+ ) {
props.onEnter(textAreaRef.current.value);
setText("");
} else if (e.key === "Escape") {