feat: cmd+enter to send
This commit is contained in:
parent
74cc772ede
commit
8fee89f31f
@ -166,6 +166,11 @@ export function NoteCreator() {
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
value={note}
|
value={note}
|
||||||
onFocus={() => dispatch(setActive(true))}
|
onFocus={() => dispatch(setActive(true))}
|
||||||
|
onKeyDown={e => {
|
||||||
|
if (e.key === "Enter" && e.metaKey) {
|
||||||
|
sendNote().catch(console.warn);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<button type="button" className="attachment" onClick={attachFile}>
|
<button type="button" className="attachment" onClick={attachFile}>
|
||||||
<Icon name="attachment" />
|
<Icon name="attachment" />
|
||||||
|
@ -50,6 +50,7 @@ interface TextareaProps {
|
|||||||
onChange(ev: React.ChangeEvent<HTMLTextAreaElement>): void;
|
onChange(ev: React.ChangeEvent<HTMLTextAreaElement>): void;
|
||||||
value: string;
|
value: string;
|
||||||
onFocus(): void;
|
onFocus(): void;
|
||||||
|
onKeyDown(ev: React.KeyboardEvent<HTMLTextAreaElement>): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Textarea = (props: TextareaProps) => {
|
const Textarea = (props: TextareaProps) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user