From 400b020118378683436905a7f35e2a5b63f55e15 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Thu, 17 Dec 2020 11:08:30 +0100 Subject: [PATCH] fix(StatusChatInput): ensure send button is disabled when message limit is exceeded This was missing in the previous work we've done to make the `StatusChatInput` work as a status timeline update component. This commit also adds an event handler which was missing to trigger the `onMessage` event when the send button is clicked. --- ui/shared/status/StatusChatInput.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/shared/status/StatusChatInput.qml b/ui/shared/status/StatusChatInput.qml index 79434d46b4..cee9ef44c2 100644 --- a/ui/shared/status/StatusChatInput.qml +++ b/ui/shared/status/StatusChatInput.qml @@ -748,8 +748,12 @@ Rectangle { anchors.rightMargin: Style.current.halfPadding anchors.bottom: parent.bottom visible: imageBtn2.visible - highlighted: chatsModel.plainText(Emoji.deparse(messageInputField.text).trim()).trim().length > 0 || isImage - enabled: highlighted + highlighted: chatsModel.plainText(Emoji.deparse(messageInputField.text)).length > 0 || isImage + enabled: highlighted && messageInputField.length < messageLimit + onClicked: function (event) { + control.sendMessage(event) + control.hideExtendedArea(); + } } StatusIconButton {