Don't compare a numeric value with a string when using the identity operator (#2989)

Fix comparison for emoji injection at cursor location
This commit is contained in:
Herohtar 2019-01-02 14:22:47 -06:00 committed by Scott Nonnenberg
parent 3f78a3c466
commit 0b60af1c84

View file

@ -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;