]> Untitled Git - lemmy-ui.git/commitdiff
Dont replace edited comment if text selected. Fixes #125
authorDessalines <tyhou13@gmx.com>
Sat, 23 Jan 2021 23:48:20 +0000 (18:48 -0500)
committerDessalines <tyhou13@gmx.com>
Sat, 23 Jan 2021 23:48:20 +0000 (18:48 -0500)
src/shared/components/markdown-textarea.tsx

index 792107b57526e4b39f5c60dbfa528d7b32f2749f..23551bcf2b8c6ceaae6370b8a888c87ab8808561 100644 (file)
@@ -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);