diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index bd2e3f46..3114c6dc 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -4,6 +4,7 @@ import autosize from "autosize"; import classNames from "classnames"; import { NoOptionI18nKeys } from "i18next"; import { Component, linkEvent } from "inferno"; +import { createElement } from "inferno-create-element"; import { Prompt } from "inferno-router"; import { Language } from "lemmy-js-client"; import { @@ -52,6 +53,7 @@ interface MarkdownTextAreaProps { onSubmit?(content: string, languageId?: number): Promise; allLanguages: Language[]; // TODO should probably be nullable siteLanguages: number[]; // TODO same + renderAsDiv?: boolean; } interface ImageUploadStatus { @@ -114,13 +116,16 @@ export class MarkdownTextArea extends Component< render() { const languageId = this.state.languageId; - - return ( -
+ return createElement( + this.props.renderAsDiv ? "div" : "form", + { + className: "markdown-textarea", + id: this.formId, + onSubmit: this.props.renderAsDiv + ? undefined + : linkEvent(this, this.handleSubmit), + }, + <> - + , ); } diff --git a/src/shared/components/home/signup.tsx b/src/shared/components/home/signup.tsx index 2af157e6..36371d05 100644 --- a/src/shared/components/home/signup.tsx +++ b/src/shared/components/home/signup.tsx @@ -303,6 +303,7 @@ export class Signup extends Component { hideNavigationWarnings allLanguages={[]} siteLanguages={[]} + renderAsDiv={true} />