From: Dessalines Date: Sat, 23 Jan 2021 23:48:20 +0000 (-0500) Subject: Dont replace edited comment if text selected. Fixes #125 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7BrepoUrl%7D?a=commitdiff_plain;h=bf52dec0a14520975bad6b77d664841f29c0b0b5;p=lemmy-ui.git Dont replace edited comment if text selected. Fixes #125 --- diff --git a/src/shared/components/markdown-textarea.tsx b/src/shared/components/markdown-textarea.tsx index 792107b..23551bc 100644 --- a/src/shared/components/markdown-textarea.tsx +++ b/src/shared/components/markdown-textarea.tsx @@ -536,7 +536,12 @@ export class MarkdownTextArea extends Component< .split('\n') .map(t => `> ${t}`) .join('\n') + '\n\n'; - this.state.content = quotedText; + if (this.state.content == null) { + this.state.content = ''; + } else { + this.state.content += '\n'; + } + this.state.content += quotedText; this.setState(this.state); // Not sure why this needs a delay setTimeout(() => autosize.update(textarea), 10);