From cf1455d414bd178f0e564885620d7bc45e714a51 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Mon, 10 Apr 2023 21:13:23 -0300 Subject: [PATCH] fix: suggestions not shown in second line of multi-line message (#4996) --- app/containers/MessageBox/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/containers/MessageBox/index.tsx b/app/containers/MessageBox/index.tsx index 53926e78d..ccd034823 100644 --- a/app/containers/MessageBox/index.tsx +++ b/app/containers/MessageBox/index.tsx @@ -487,7 +487,9 @@ class MessageBox extends Component { this.handleTyping(!isTextEmpty); const { start, end } = this.selection; const cursor = Math.max(start, end); - const txt = cursor < text.length ? text.substr(0, cursor).split(' ') : text.split(' '); + const whiteSpaceOrBreakLineRegex = /[\s\n]+/; + const txt = + cursor < text.length ? text.substr(0, cursor).split(whiteSpaceOrBreakLineRegex) : text.split(whiteSpaceOrBreakLineRegex); const lastWord = txt[txt.length - 1]; const result = lastWord.substring(1);