fix(desktop/chat): [base_bc] selecting a channel does not auto-focus on the text input field

When new channel/chat is displayed, text input field focus is forced properly.

Fixes #4524
This commit is contained in:
Noelia 2022-01-27 18:14:21 +01:00 committed by Sale Djenic
parent 16225a3af9
commit d8a7a3d812
2 changed files with 12 additions and 0 deletions

View File

@ -38,6 +38,14 @@ ColumnLayout {
property bool stickersLoaded: false property bool stickersLoaded: false
// NOTE: Used this property change as it is the current way used for displaying new channel/chat data of content view.
// If in the future content is loaded dynamically, input focus should be activated when loaded / created content view.
onHeightChanged: {
if(chatContentRoot.height > 0) {
chatInput.forceInputActiveFocus()
}
}
StatusChatToolBar { StatusChatToolBar {
id: topBar id: topBar
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -563,6 +563,10 @@ Rectangle {
messageInputField.forceActiveFocus(); messageInputField.forceActiveFocus();
} }
function forceInputActiveFocus() {
messageInputField.forceActiveFocus();
}
Connections { Connections {
target: Global.applicationWindow.dragAndDrop target: Global.applicationWindow.dragAndDrop
onDroppedOnValidScreen: (drop) => { onDroppedOnValidScreen: (drop) => {