Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji not always inserted at the correct position #4265

Open
PVince81 opened this issue Oct 2, 2020 · 6 comments
Open

Emoji not always inserted at the correct position #4265

PVince81 opened this issue Oct 2, 2020 · 6 comments

Comments

@PVince81
Copy link
Member

PVince81 commented Oct 2, 2020

Steps to reproduce

  1. Enter a chat room
  2. Type some text "abcdef"
  3. Set the cursor behind "c"
  4. Pick an emoji from the picker
  5. Repeat with "b", "a" and other letters

Expected behaviour

Emoji always inserted at the cursor's position

Actual behaviour

Often times the emoji is inserted at the end of the field.

Talk app

git master 4e290c0 (10.0.0)

Browser

Chromium 85.0.4183.102

I see in NewMessageForm.vue that there's some gymnastics required to insert emojis, so I suspect that not all the cases are covered. It is also possible that sometimes the browser's internal selection/range is lost when clicking outside.

@danxuliu
Copy link
Member

danxuliu commented Oct 2, 2020

Also see #3943 (comment)

@PVince81
Copy link
Member Author

PVince81 commented Oct 7, 2020

found this: it seems that a new div gets created sometimes when inserting an emoji:
image

@PVince81
Copy link
Member Author

PVince81 commented Oct 7, 2020

would be nice if we could just get rid of all those divs... it's already a real pain here with newlines #4259 (comment)

interestingly, pasting text that contains newlines will insert true newlines, no "br" nor "div"

@ShGKme
Copy link
Contributor

ShGKme commented Feb 20, 2023

  • Emoji should be inserted in the last caret position, if any. Otherwise - in the end
  • Emoji should replace the last selected
  • If the last character is a new line \n, an emoji should be added to the last line
  • Focus should return to the last caret position after inserted emoji once the picker is closed

The current solution doesn't work because the message input's focus and selection are lost after clicking NcEmojiPicker. Also, it expects a new line to be added by <br>, while it is \n

@nickvergessen
Copy link
Member

Now a bug of the vue library, right?

@ShGKme
Copy link
Contributor

ShGKme commented Aug 24, 2023

Now a bug of the vue library, right?

It is not. Vue library implements only emoji picker in text.

image

But we also have a button with additional NcEmojiPicker in Talk.

image

So I can see 3 options here:

  1. Remove NcEmojiPicker in Talk and always use : emoji picker
  2. Fix the problem
  3. Fix the problem and add this additional picker for the vue lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants