Fix new line in TextInput when using Send By Enter

Fixed the issue by removing the enter that gets added to textarea
when enter is pressed using string operations.
This commit is contained in:
Santhosh Manikandan S 2021-05-03 23:16:16 +05:30
parent 23d4ac6c02
commit 93da676e6b

View file

@ -1901,6 +1901,8 @@ Page {
enabled: !attachmentPreviewRow.isLocation
EnterKey.onClicked: {
if (appSettings.sendByEnter) {
var messageText = newMessageTextField.text;
newMessageTextField.text = messageText.substring(0, newMessageTextField.cursorPosition -1) + messageText.substring(newMessageTextField.cursorPosition);
sendMessage();
newMessageTextField.text = "";
if(!appSettings.focusTextAreaAfterSend) {