From 6d8ea89f09e9fdc8df691bdc7d2304beda87a9f8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 6 Nov 2018 02:05:16 +0900 Subject: [PATCH] Resolve #3126 --- src/client/app/common/views/components/autocomplete.vue | 5 +++++ src/client/app/common/views/directives/autocomplete.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/app/common/views/components/autocomplete.vue b/src/client/app/common/views/components/autocomplete.vue index 4cf44a23a..661d34086 100644 --- a/src/client/app/common/views/components/autocomplete.vue +++ b/src/client/app/common/views/components/autocomplete.vue @@ -215,6 +215,11 @@ export default Vue.extend({ } } } else if (this.type == 'emoji') { + if (this.q == null || this.q == '') { + this.emojis = this.emojiDb.filter(x => x.isCustomEmoji && !x.aliasOf); + return; + } + const matched = []; const max = 30; diff --git a/src/client/app/common/views/directives/autocomplete.ts b/src/client/app/common/views/directives/autocomplete.ts index ca0c79212..069aeb278 100644 --- a/src/client/app/common/views/directives/autocomplete.ts +++ b/src/client/app/common/views/directives/autocomplete.ts @@ -109,7 +109,7 @@ class Autocomplete { if (isEmoji && opened == false) { const emoji = text.substr(emojiIndex + 1); - if (emoji != '' && emoji.match(/^[\+\-a-z0-9_]+$/)) { + if (!emoji.includes(' ')) { this.open('emoji', emoji); opened = true; }