Skip to content

Commit

Permalink
submit on ctrl-enter
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Apr 29, 2023
1 parent 16ad81f commit 6b271a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/components/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ export default function MessageInput(props: MessageInputProps) {
const hotkeyHandler = useMemo(() => {
const keys = [
['Escape', blur, { preventDefault: true }],
['ctrl+Enter', onSubmit, { preventDefault: true }],

];
if (submitOnEnter) {
keys.unshift(['Enter', onSubmit, { preventDefault: true }]);
Expand Down

0 comments on commit 6b271a4

Please sign in to comment.