feat: cmd+enter to send

This commit is contained in:
Kieran 2023-04-10 10:59:38 +01:00
parent 74cc772ede
commit 8fee89f31f
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 6 additions and 0 deletions

View File

@ -166,6 +166,11 @@ export function NoteCreator() {
onChange={onChange}
value={note}
onFocus={() => dispatch(setActive(true))}
onKeyDown={e => {
if (e.key === "Enter" && e.metaKey) {
sendNote().catch(console.warn);
}
}}
/>
<button type="button" className="attachment" onClick={attachFile}>
<Icon name="attachment" />

View File

@ -50,6 +50,7 @@ interface TextareaProps {
onChange(ev: React.ChangeEvent<HTMLTextAreaElement>): void;
value: string;
onFocus(): void;
onKeyDown(ev: React.KeyboardEvent<HTMLTextAreaElement>): void;
}
const Textarea = (props: TextareaProps) => {