From 26e1acfc84cee563435c8044c840853d47509df3 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Fri, 27 Aug 2021 03:09:15 +0300 Subject: [PATCH] Fix suggesting emoji with white space --- src/components/chat/input.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/chat/input.ts b/src/components/chat/input.ts index c62d3ff2..eac7cd37 100644 --- a/src/components/chat/input.ts +++ b/src/components/chat/input.ts @@ -1303,7 +1303,7 @@ export default class ChatInput { if(matches) { const entity = entities[0]; - const query = matches[2]; + let query = matches[2]; const firstChar = query[0]; if(this.stickersHelper && @@ -1322,7 +1322,8 @@ export default class ChatInput { foundHelper = this.commandsHelper; } } else if(rootScope.settings.emoji.suggest) { // emoji - if(!value.match(/^\s*:(.+):\s*$/) && !value.match(/:[;!@#$%^&*()-=|]/)) { + query = query.replace(/^\s*/, ''); + if(!value.match(/^\s*:(.+):\s*$/) && !value.match(/:[;!@#$%^&*()-=|]/) && query) { foundHelper = this.emojiHelper; this.emojiHelper.checkQuery(query, firstChar); }