From bf52dec0a14520975bad6b77d664841f29c0b0b5 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 23 Jan 2021 18:48:20 -0500 Subject: [PATCH] Dont replace edited comment if text selected. Fixes #125 --- src/shared/components/markdown-textarea.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.44.1