Skip to content

Commit

Permalink
fix: do not append whitespace to emoji if whitespace is already present
Browse files Browse the repository at this point in the history
  • Loading branch information
aswin-s committed Nov 7, 2023
1 parent f2c1022 commit 639136a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function ComposerWithSuggestions({
(commentValue, shouldDebounceSaveComment) => {
raiseIsScrollLikelyLayoutTriggered();
const {startIndex, endIndex, diff} = findNewlyAddedChars(lastTextRef.current, commentValue);
const isEmojiInserted = diff.length && endIndex > startIndex && EmojiUtils.containsOnlyEmojis(diff);
const isEmojiInserted = diff.length && endIndex > startIndex && diff.trim() === diff && EmojiUtils.containsOnlyEmojis(diff);
const {text: newComment, emojis} = EmojiUtils.replaceAndExtractEmojis(
isEmojiInserted ? insertWhiteSpace(commentValue, endIndex) : commentValue,
preferredSkinTone,
Expand Down

0 comments on commit 639136a

Please sign in to comment.