diff --git a/src/utils/emoji-index.js b/src/utils/emoji-index.js index d50c288..aac3a79 100644 --- a/src/utils/emoji-index.js +++ b/src/utils/emoji-index.js @@ -28,6 +28,10 @@ function search(value, { emojisToShowFilter, maxResults, include, exclude } = {} pool = data.emojis if (value.length) { + if (value == '-' || value == '-1') { + return [emojisList['-1']] + } + var values = value.toLowerCase().split(/[\s|,|\-|_]+/), allResults = [] @@ -54,10 +58,6 @@ function search(value, { emojisToShowFilter, maxResults, include, exclude } = {} aIndex = index, length = 0 - if (value == '-' || value == '-1') { - return [emojisList['-1']] - } - for (let char of value.split('')) { length++