Skip to content

Commit 2aa8ad8

Browse files
committed
fix: The list of users in mentions does not disappear when using the Shift+Enter
1 parent 39b575c commit 2aa8ad8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/home/report/ReportActionCompose/SuggestionMention.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ function SuggestionMention({
203203
suggestionEndIndex = indexOfFirstSpecialCharOrEmojiAfterTheCursor + selectionEnd;
204204
}
205205

206-
const leftString = value.substring(0, suggestionEndIndex);
206+
const newLineIndex = value.lastIndexOf('\n', selectionEnd - 1);
207+
const leftString = value.substring(newLineIndex + 1, suggestionEndIndex);
207208
const words = leftString.split(CONST.REGEX.SPACE_OR_EMOJI);
208209
const lastWord = _.last(words);
209210
const secondToLastWord = words[words.length - 3];

0 commit comments

Comments
 (0)