diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 4b5e7d0240..19c336fbab 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -618,6 +618,14 @@ Rectangle { StatusEmojiSuggestionPopup { id: emojiSuggestions messageInput: messageInput + onClicked: function (index) { + if (index === undefined) { + index = emojiSuggestions.listView.currentIndex + } + + const unicode = emojiSuggestions.modelList[index].unicode_alternates || emojiSuggestions.modelList[index].unicode + replaceWithEmoji(extrapolateCursorPosition(), emojiSuggestions.shortname, unicode); + } } SuggestionBoxPanel { diff --git a/ui/imports/shared/status/StatusEmojiSuggestionPopup.qml b/ui/imports/shared/status/StatusEmojiSuggestionPopup.qml index 807fc3e390..702af03564 100644 --- a/ui/imports/shared/status/StatusEmojiSuggestionPopup.qml +++ b/ui/imports/shared/status/StatusEmojiSuggestionPopup.qml @@ -8,6 +8,7 @@ import shared 1.0 StatusInputListPopup { id: emojiSuggestions + property string shortname property string unicode: { if(listView.currentIndex < 0 || listView.currentIndex >= emojiSuggestions.modelList.count) @@ -26,9 +27,6 @@ StatusInputListPopup { getId: function (modelData) { return modelData.unicode } - onClicked: function (index) { - emojiSuggestions.addEmoji(index) - } function openPopup(emojisParam, shortnameParam) { modelList = emojisParam