From de9f7b13babb5f9656da797c863064578a3a49c3 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Tue, 4 May 2021 17:18:54 -0400
Subject: fixed multiple mentions getting populated

---
 src/components/comments/AddComment.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/components/comments/AddComment.tsx')

diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx
index f9c5669b..cce846e5 100644
--- a/src/components/comments/AddComment.tsx
+++ b/src/components/comments/AddComment.tsx
@@ -116,7 +116,12 @@ const AddComment: React.FC<AddCommentProps> = ({
             containerStyle={styles.text}
             placeholder={placeholderText}
             value={inReplyToMention + comment}
-            onChange={setComment}
+            onChange={(newText: string) => {
+              // skipping the `inReplyToMention` text
+              setComment(
+                newText.substring(inReplyToMention.length, newText.length),
+              );
+            }}
             inputRef={ref}
             partTypes={mentionPartTypes}
           />
-- 
cgit v1.2.3-70-g09d2

