fix(desktop/chatinput) fixed automatic emoji replacement missbehavior

Closes #3203
This commit is contained in:
Alexandra Betouni 2021-08-17 14:10:59 +03:00 committed by Iuri Matias
parent c43d0149ee
commit f218fbf739
1 changed files with 2 additions and 1 deletions

View File

@ -859,7 +859,8 @@ Rectangle {
persistentSelection: true persistentSelection: true
onTextChanged: { onTextChanged: {
var symbols = ":='xX><0O;*dB8-D#%\\"; var symbols = ":='xX><0O;*dB8-D#%\\";
if ((length > 1) && (symbols.indexOf(getText((cursorPosition - 2), (cursorPosition - 1))) !== -1)) { if ((length > 1) && (symbols.indexOf(getText((cursorPosition - 2), (cursorPosition - 1))) !== -1)
&& (!getText((cursorPosition - 7), cursorPosition).includes("http"))) {
const emojis = EmojiJSON.emoji_json.filter(function (emoji) { const emojis = EmojiJSON.emoji_json.filter(function (emoji) {
if (emoji.aliases_ascii.includes(getText((cursorPosition - 2), cursorPosition)) || if (emoji.aliases_ascii.includes(getText((cursorPosition - 2), cursorPosition)) ||
emoji.aliases_ascii.includes(getText((cursorPosition - 3), cursorPosition))) { emoji.aliases_ascii.includes(getText((cursorPosition - 3), cursorPosition))) {