diff --git a/pkg/interface/src/views/apps/publish/components/lib/CommentInput.tsx b/pkg/interface/src/views/apps/publish/components/lib/CommentInput.tsx index af6af3ba1..4830f2067 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/CommentInput.tsx +++ b/pkg/interface/src/views/apps/publish/components/lib/CommentInput.tsx @@ -1,7 +1,7 @@ import React from "react"; import * as Yup from "yup"; -import { Formik, FormikHelpers, Form } from "formik"; -import { AsyncButton } from '../../../../components/AsyncButton'; +import { Formik, FormikHelpers, Form, useFormikContext } from "formik"; +import { AsyncButton } from "../../../../components/AsyncButton"; import { TextArea } from "@tlon/indigo-react"; interface FormSchema { @@ -22,11 +22,21 @@ interface CommentInputProps { label?: string; placeholder?: string; } +const SubmitTextArea = (props) => { + const { submitForm } = useFormikContext(); + const onKeyDown = (e: KeyboardEvent) => { + if ((e.getModifierState("Control") || e.metaKey) && e.key === "Enter") { + submitForm(); + } + }; + return