fix: cursor position
This commit is contained in:
parent
9d9f51c080
commit
554128da50
|
@ -194,10 +194,11 @@ Rectangle {
|
||||||
// we can only get it in the `released` event
|
// we can only get it in the `released` event
|
||||||
if (paste) {
|
if (paste) {
|
||||||
paste = false;
|
paste = false;
|
||||||
|
const posBeforeEnd = messageInputField.length - messageInputField.cursorPosition;
|
||||||
const deparsedEmoji = Emoji.deparse(messageInputField.text);
|
const deparsedEmoji = Emoji.deparse(messageInputField.text);
|
||||||
const plainText = chatsModel.plainText(deparsedEmoji);
|
const plainText = chatsModel.plainText(deparsedEmoji);
|
||||||
messageInputField.text = Emoji.parse(plainText.replace(/\n/g, "<br />"));
|
messageInputField.text = Emoji.parse(plainText.replace(/\n/g, "<br />"));
|
||||||
messageInputField.cursorPosition = messageInputField.length;
|
messageInputField.cursorPosition = messageInputField.length - posBeforeEnd;
|
||||||
|
|
||||||
interrogateMessage();
|
interrogateMessage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue