Bug 456641

Summary: When adding an emoji, text cursor is moved to beginning
Product: [Applications] NeoChat Reporter: Jan Bidler <janbidler00>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: normal CC: carl
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jan Bidler 2022-07-12 16:31:03 UTC
SUMMARY
When adding an emoji via the emoji picker, the text cursor is moved to the beginning of the message

STEPS TO REPRODUCE
1. Open neochat and a room
2. Start typing "Hello from Neochat!"
3. Click on the emoji picker and select "😀"


OBSERVED RESULT
The text cursor will be moved to the beginning, aka before "Hello"

EXPECTED RESULT
The text cursor should stay as is

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.18.9-arch1-1 (64-bit)
Graphics Platform: Wayland
NeoChat: 22.06

ADDITIONAL INFORMATION
Works on multiline messages as well
Comment 1 Bug Janitor Service 2022-11-24 22:01:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/662
Comment 2 Tobias Fella 2022-11-25 19:50:07 UTC
Git commit 9d8cc5c9072b3a5b7ee4f5ec22fabcee96eff30b by Tobias Fella.
Committed on 25/11/2022 at 17:05.
Pushed by tfella into branch 'master'.

Fix cursor position when inserting emoji

M  +1    -0    src/qml/Component/ChatBox/ChatBar.qml
M  +4    -6    src/qml/Component/ChatBox/ChatBox.qml

https://invent.kde.org/network/neochat/commit/9d8cc5c9072b3a5b7ee4f5ec22fabcee96eff30b