From b350487fb912527bdfe678d9b462354d36ac4c1e Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Tue, 25 May 2021 23:15:43 +0200 Subject: [PATCH] Adjust scroll position handling when chat window height changes, fixes #418 --- qml/pages/ChatPage.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 19fadce..e66ea2f 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -1050,8 +1050,13 @@ Page { } onHeightChanged: { - var deltaHeight = previousHeight - height; - chatView.contentY = chatView.contentY + deltaHeight; + console.log("Height changed, previous: " + previousHeight + ", now: " + height); + if (previousHeight > height) { + var deltaHeight = previousHeight - height; + chatView.contentY = chatView.contentY + deltaHeight; + } else { + chatView.handleScrollPositionChanged(); + } previousHeight = height; }