From 0b60af1c848ba4895ea1bdd5829c6127dc8c2d61 Mon Sep 17 00:00:00 2001 From: Herohtar Date: Wed, 2 Jan 2019 14:22:47 -0600 Subject: [PATCH] Don't compare a numeric value with a string when using the identity operator (#2989) Fix comparison for emoji injection at cursor location --- js/views/conversation_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 1d86224c0263..4fdec85818a7 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -1456,7 +1456,7 @@ const colons = `:${emojiData[e.index].short_name}:`; const textarea = this.$messageField[0]; - if (textarea.selectionStart || textarea.selectionStart === '0') { + if (textarea.selectionStart || textarea.selectionStart === 0) { const startPos = textarea.selectionStart; const endPos = textarea.selectionEnd;