From 1f91259c788a599622092db8c1ce441dd2f4350f Mon Sep 17 00:00:00 2001 From: Lyndon Jetten Date: Tue, 22 Nov 2022 13:22:28 +0100 Subject: [PATCH] =?UTF-8?q?Nach=20dem=20Einf=C3=BCgen=20eines=20Emojis=20w?= =?UTF-8?q?ird=20der=20Cursor=20direkt=20hinter=20das=20Emoji=20gesetzt=20?= =?UTF-8?q?und=20nicht=20mehr=20wie=20bisher=20am=20Ende=20des=20Texts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChatController/ChatEmojiiControl.xaml.cs | 6 ++++-- ChatController/ChatMainControl.xaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChatController/ChatEmojiiControl.xaml.cs b/ChatController/ChatEmojiiControl.xaml.cs index 5bc95a3..fc14c8f 100644 --- a/ChatController/ChatEmojiiControl.xaml.cs +++ b/ChatController/ChatEmojiiControl.xaml.cs @@ -88,8 +88,10 @@ namespace ChatController (ThreadStart) delegate { _ChatMainControl.Chatbox.Focus(); - _ChatMainControl.Chatbox.Text += emojiCode; - _ChatMainControl.Chatbox.SelectionStart = _ChatMainControl.Chatbox.Text.Length; + + var selectionStart = _ChatMainControl.Chatbox.SelectionStart; + _ChatMainControl.Chatbox.Text = _ChatMainControl.Chatbox.Text.Insert(selectionStart, emojiCode); + _ChatMainControl.Chatbox.SelectionStart = selectionStart + emojiCode.Length; }); } catch (Exception e) diff --git a/ChatController/ChatMainControl.xaml b/ChatController/ChatMainControl.xaml index 99a5d64..e225a20 100644 --- a/ChatController/ChatMainControl.xaml +++ b/ChatController/ChatMainControl.xaml @@ -534,7 +534,7 @@ - +