Allow posting using Command+Enter on mac

This commit is contained in:
hzrd149 2024-07-24 07:56:22 -05:00
parent 2a7cad6d9e
commit a457f330a1
4 changed files with 4 additions and 4 deletions

View File

@ -194,7 +194,7 @@ export default function PostModal({
instanceRef={(inst) => (textAreaRef.current = inst)}
onPaste={onPaste}
onKeyDown={(e) => {
if (e.ctrlKey && e.key === "Enter") submit();
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") submit();
}}
/>
{previewDraft.content.length > 0 && (

View File

@ -76,7 +76,7 @@ export default function ChannelMessageForm({
ref={textAreaRef}
onPaste={onPaste}
onKeyDown={(e) => {
if (e.ctrlKey && e.key === "Enter" && formRef.current) formRef.current.requestSubmit();
if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && formRef.current) formRef.current.requestSubmit();
}}
/>
<Button type="submit">Send</Button>

View File

@ -92,7 +92,7 @@ export default function SendMessageForm({
ref={textAreaRef}
onPaste={onPaste}
onKeyDown={(e) => {
if (e.ctrlKey && e.key === "Enter" && formRef.current) formRef.current.requestSubmit();
if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && formRef.current) formRef.current.requestSubmit();
}}
/>
<Button type="submit">Send</Button>

View File

@ -87,7 +87,7 @@ export default function ReplyForm({ item, onCancel, onSubmitted, replyKind = kin
instanceRef={(inst) => (textAreaRef.current = inst)}
onPaste={onPaste}
onKeyDown={(e) => {
if (e.ctrlKey && e.key === "Enter" && formRef.current) formRef.current.requestSubmit();
if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && formRef.current) formRef.current.requestSubmit();
}}
/>
<Flex gap="2" alignItems="center">