fix streaming scroll: use Timer.singleShot + positionViewAtIndex

This commit is contained in:
Levi Neely 2026-08-01 10:20:50 +02:00
parent df41aad5cb
commit 50c3b5979c
1 changed files with 12 additions and 3 deletions

View File

@ -313,14 +313,23 @@ ApplicationWindow {
boundsBehavior: Flickable.StopAtBounds
onCountChanged: {
Qt.callLater(function() { positionViewAtEnd() })
if (count > 0) {
var idx = count - 1
Timer.singleShot(0, function() {
positionViewAtIndex(idx, ListView.End)
})
}
}
Connections {
target: chatModel
function onDataChanged() {
if (chatView.atYEnd)
Qt.callLater(function() { chatView.positionViewAtEnd() })
if (chatView.atYEnd && chatView.count > 0) {
var idx = chatView.count - 1
Timer.singleShot(0, function() {
chatView.positionViewAtIndex(idx, ListView.End)
})
}
}
}