Skip to content

Commit 27ee38b

Browse files
authored
Merge pull request #20149 from dukenv0307/fix/19289
Fix: remove replace function when inserting emoji
2 parents 03c743a + 7035113 commit 27ee38b

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/CONST.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,6 @@ const CONST = {
11221122
// eslint-disable-next-line no-misleading-character-class
11231123
/[\n\s,/?"{}[\]()&^%$#<>!*\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
11241124

1125-
// Define the regular expression pattern to match a string starting with a colon and ending with a space or newline character
1126-
EMOJI_REPLACER: /^:[^\n\r]+?(?=$|\s)/,
1127-
11281125
// Define the regular expression pattern to match a string starting with an at sign and ending with a space or newline character
11291126
MENTION_REPLACER:
11301127
// eslint-disable-next-line no-misleading-character-class
@@ -1302,7 +1299,6 @@ const CONST = {
13021299

13031300
USA_COUNTRY_NAME,
13041301
SPACE_LENGTH: 1,
1305-
SPACE: 1,
13061302

13071303
ALL_COUNTRIES: {
13081304
AF: 'Afghanistan',

src/pages/home/report/ReportActionCompose.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ class ReportActionCompose extends React.Component {
627627
const commentBeforeColon = this.state.value.slice(0, this.state.colonIndex);
628628
const emojiObject = this.state.suggestedEmojis[highlightedEmojiIndex];
629629
const emojiCode = emojiObject.types && emojiObject.types[this.props.preferredSkinTone] ? emojiObject.types[this.props.preferredSkinTone] : emojiObject.code;
630-
const commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end).replace(CONST.REGEX.EMOJI_REPLACER, CONST.SPACE);
630+
const commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end);
631631

632632
this.updateComment(`${commentBeforeColon}${emojiCode} ${this.trimLeadingSpace(commentAfterColonWithEmojiNameRemoved)}`, true);
633633
// In some Android phones keyboard, the text to search for the emoji is not cleared

0 commit comments

Comments
 (0)