aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-04 17:18:54 -0400
committerIvan Chen <ivan@tagg.id>2021-05-04 20:48:08 -0400
commitde9f7b13babb5f9656da797c863064578a3a49c3 (patch)
treeada8bf0313ce7d133f8c70228e3bd5b38271ed73 /src/components/comments
parent9795083f41e6417c32d9c070ab0b2bf4aca67012 (diff)
fixed multiple mentions getting populated
Diffstat (limited to 'src/components/comments')
-rw-r--r--src/components/comments/AddComment.tsx7
1 files changed, 6 insertions, 1 deletions
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}
/>