Skip to content
Snippets Groups Projects
Commit 0895a9f1 authored by Liam Coursodon's avatar Liam Coursodon Committed by Sébastien Blin
Browse files

TextEditor: patch height binding after tap big message

Change-Id: I91111ff3b4d54dda85e649e62eef91ad9b935bb8
parent e8075a41
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,8 @@ Rectangle {
var editedMessageBody = MessagesAdapter.dataForInteraction(MessagesAdapter.editId, MessageList.Body);
messageBar.textAreaObj.insertText(editedMessageBody);
messageBar.textAreaObj.forceActiveFocus();
} else {
messageBar.textAreaObj.clearText();
}
}
......@@ -115,7 +117,6 @@ Rectangle {
EditContainer {
id: editContainer
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: footerColumnLayout.width
Layout.maximumWidth: JamiTheme.chatViewMaximumWidth
......
......@@ -190,8 +190,12 @@ RowLayout {
onSendMessagesRequired: {
sendMessageButtonClicked();
}
onTextChanged: MessagesAdapter.userIsComposing(text ? true : false)
onTextChanged: {
MessagesAdapter.userIsComposing(text ? true : false);
if (!text) {
messageBarTextArea.heightBinding();
}
}
property var markdownShortCut: {
"Bold": function () {
if (!showPreview) {
......
......@@ -48,7 +48,7 @@ JamiFlickable {
signal sendMessagesRequired
function heightBinding() {
textArea.height = Qt.binding(() => textArea.paintedHeight);
textArea.height = Qt.binding(() => textArea.lineCount === 1 ? 35 : textArea.paintedHeight);
}
function selectText(start, end) {
......@@ -60,7 +60,11 @@ JamiFlickable {
}
function clearText() {
var multiLine = textArea.lineCount !== 1;
textArea.clear();
if (multiLine) {
heightBinding();
}
}
function pasteText() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment