Skip to content

Commit

Permalink
Don't compare a numeric value with a string when using the identity o…
Browse files Browse the repository at this point in the history
…perator (#2989)

Fix comparison for emoji injection at cursor location
  • Loading branch information
Herohtar authored and scottnonnenberg-signal committed Jan 2, 2019
1 parent 3f78a3c commit 0b60af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/views/conversation_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0b60af1

Please sign in to comment.