From 8c32dbc487918c5356ef79d84956c2e224f244a2 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Mon, 26 Nov 2018 12:17:40 +0800 Subject: [PATCH] Fix #120. --- imports/Spectral/Menu/MessageContextMenu.qml | 1 + imports/Spectral/Panel/RoomPanelInput.qml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/imports/Spectral/Menu/MessageContextMenu.qml b/imports/Spectral/Menu/MessageContextMenu.qml index 087b018..62c7c74 100644 --- a/imports/Spectral/Menu/MessageContextMenu.qml +++ b/imports/Spectral/Menu/MessageContextMenu.qml @@ -41,6 +41,7 @@ Menu { roomPanelInput.replyEventID = model.eventId roomPanelInput.replyContent = selectedText != "" ? selectedText : model.message roomPanelInput.isReply = true + roomPanelInput.focus() } } MenuItem { diff --git a/imports/Spectral/Panel/RoomPanelInput.qml b/imports/Spectral/Panel/RoomPanelInput.qml index 15ac6cc..6e1bdd5 100644 --- a/imports/Spectral/Panel/RoomPanelInput.qml +++ b/imports/Spectral/Panel/RoomPanelInput.qml @@ -214,7 +214,7 @@ Control { selectByMouse: true verticalAlignment: TextEdit.AlignVCenter - text: currentRoom ? currentRoom.cachedInput : "" + text: currentRoom != null ? currentRoom.cachedInput : "" background: Item { } @@ -389,4 +389,8 @@ Control { replyEventID = "" replyContent = "" } + + function focus() { + inputField.forceActiveFocus() + } }