fix scroll: defer positionViewAtEnd to after layout
This commit is contained in:
parent
2bd7a2dca0
commit
2d2ba1eeaf
|
|
@ -307,16 +307,14 @@ ApplicationWindow {
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
onCountChanged: {
|
onCountChanged: {
|
||||||
if (count > 0) {
|
Qt.callLater(function() { positionViewAtEnd() })
|
||||||
positionViewAtEnd()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: chatModel
|
target: chatModel
|
||||||
function onDataChanged() {
|
function onDataChanged() {
|
||||||
if (chatView.atYEnd)
|
if (chatView.atYEnd)
|
||||||
chatView.positionViewAtEnd()
|
Qt.callLater(function() { chatView.positionViewAtEnd() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in New Issue