diff --git a/src/components/post-modal/index.tsx b/src/components/post-modal/index.tsx index 518c10767..e5619a0c2 100644 --- a/src/components/post-modal/index.tsx +++ b/src/components/post-modal/index.tsx @@ -158,6 +158,8 @@ export default function PostModal({ ); } + + // TODO: wrap this in a form return ( <> {requireSubject && } @@ -170,6 +172,9 @@ export default function PostModal({ isRequired instanceRef={(inst) => (textAreaRef.current = inst)} onPaste={onPaste} + onKeyDown={(e) => { + if (e.ctrlKey && e.key === "Enter") submit(); + }} /> {getValues().content.length > 0 && ( diff --git a/src/views/note/components/reply-form.tsx b/src/views/note/components/reply-form.tsx index d9d3f78c6..da77ff2e3 100644 --- a/src/views/note/components/reply-form.tsx +++ b/src/views/note/components/reply-form.tsx @@ -95,8 +95,10 @@ export default function ReplyForm({ item, onCancel, onSubmitted, replyKind = Kin } }); + const formRef = useRef(null); + return ( - + f.type.includes("image")); if (imageFile) uploadImage(imageFile); }} + onKeyDown={(e) => { + if (e.ctrlKey && e.key === "Enter" && formRef.current) formRef.current.requestSubmit(); + }} />