Fix taking focus for chat

This commit is contained in:
miruka
2019-12-09 14:13:38 -04:00
parent 2e780d7c6a
commit bd8bf6120e
4 changed files with 9 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import "RoomSidePane"
Item {
id: chat
onFocusChanged: if (focus && loader.item) loader.item.composer.takeFocus()
property string userId: ""
@@ -39,9 +40,11 @@ Item {
HLoader {
id: loader
anchors.rightMargin: roomSidePane.visibleWidth
anchors.fill: parent
visible: ! roomSidePane.hidden || anchors.rightMargin < width
onLoaded: if (chat.focus) item.composer.takeFocus()
source: ready ? "ChatPage.qml" : ""

View File

@@ -14,7 +14,9 @@ HPage {
// The target will be our EventList, not the page itself
becomeKeyboardFlickableTarget: false
Component.onCompleted: composer.takeFocus()
readonly property alias composer: composer
RoomHeader {
Layout.fillWidth: true