Signal-desktop: Emoji is added to end of message, not at caret position

Created on 18 Dec 2018  路  2Comments  路  Source: signalapp/Signal-Desktop

  • [x] I have searched open and closed issues for duplicates

Bug Description

When selecting an emoji from the emoji picker, it is always added to the end of the current messege, not inserted at the caret position.

Steps to Reproduce

  1. Write something, anything
  2. Place caret position somewhere before the end of the message. For example at the first character position.
  3. Select an emoji

Actual Result:
Emoji appears at the end of the message

Expected Result:
Emoji appeared at the position of the caret. For example at the beginning of the message

Screenshots


caret at beginning of message
emoji appended to end of message

Platform Info

Signal Version:


v1.19.0

Operating System:


Windows 10 Enterprise
Version 1803
OS build 17134.345

Linked Device Version:


Signal 4.31.6

Link to Debug Log

Can't really see why this is necessary here. I'll add a log if asked in a comment.

Most helpful comment

And here's the issue: https://github.com/signalapp/Signal-Desktop/blob/3f78a3c466db2d8e3803b9ad45dba764b37e667f/js/views/conversation_view.js#L1459

textarea.selectionStart is a numeric value, not a string. I can submit a PR later this afternoon.

All 2 comments

I just reproduced this, and it seems this is actually only a problem when the cursor is at the very beginning of the message. Putting the cursor immediately after the first character or anywhere else inserted the emoji text as expected, but putting the cursor at the start of the message resulted in the text being appended to the end instead.

And here's the issue: https://github.com/signalapp/Signal-Desktop/blob/3f78a3c466db2d8e3803b9ad45dba764b37e667f/js/views/conversation_view.js#L1459

textarea.selectionStart is a numeric value, not a string. I can submit a PR later this afternoon.

Was this page helpful?
0 / 5 - 0 ratings