From 7e06606cbdf444631b5521127f4ef938b470dbaf Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 14 Mar 2023 13:05:52 +0100 Subject: [PATCH] Don't focus chatbar on mobile This popup the virtual keyboard and is quite distrubing on mobile. Signed-off-by: Carl Schwan (cherry picked from commit bc84ad8d566b8aae47beb7086bb5f14d8ab071fb) --- src/qml/Page/RoomPage.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/qml/Page/RoomPage.qml b/src/qml/Page/RoomPage.qml index f8a252c83..20e3978a2 100644 --- a/src/qml/Page/RoomPage.qml +++ b/src/qml/Page/RoomPage.qml @@ -48,7 +48,9 @@ Kirigami.ScrollablePage { applicationWindow().hoverLinkIndicator.text = ""; messageListView.positionViewAtBeginning(); hasScrolledUpBefore = false; - chatBox.chatBar.forceActiveFocus(); + if (!Kirigami.Settings.isMobile) { + chatBox.chatBar.forceActiveFocus(); + } } Connections { @@ -353,7 +355,9 @@ Kirigami.ScrollablePage { visible: currentRoom && currentRoom.hasUnreadMessages && currentRoom.readMarkerLoaded action: Kirigami.Action { onTriggered: { - chatBox.chatBar.forceActiveFocus(); + if (!Kirigami.Settings.isMobile) { + chatBox.chatBar.forceActiveFocus(); + } messageListView.goToEvent(currentRoom.readMarkerEventId) } icon.name: "go-up" @@ -378,7 +382,9 @@ Kirigami.ScrollablePage { visible: !messageListView.atYEnd action: Kirigami.Action { onTriggered: { - chatBox.chatBar.forceActiveFocus(); + if (!Kirigami.Settings.isMobile) { + chatBox.chatBar.forceActiveFocus(); + } goToLastMessage(); currentRoom.markAllMessagesAsRead(); } @@ -531,7 +537,9 @@ Kirigami.ScrollablePage { showQuickReaction: true onChosen: { page.currentRoom.toggleReaction(hoverActions.event.eventId, emoji); - chatBox.chatBar.forceActiveFocus(); + if (!Kirigami.Settings.isMobile) { + chatBox.chatBar.forceActiveFocus(); + } } } }