Commit 2b4c17be authored by Ronan's avatar Ronan
Browse files

fix(ui/modules/Linphone/Chat/Chat): use a timeout to scroll at end

parent 1472adcb
......@@ -5,7 +5,6 @@
function initView () {
chat.tryToLoadMoreEntries = false
chat.bindToEnd = true
chat.positionViewAtEnd()
}
function loadMoreEntries () {
......@@ -48,15 +47,6 @@ function handleMovementStarted () {
chat.bindToEnd = false
}
function handleDataChanged (_, bottomRight) {
var n = chat.count
var index = bottomRight.row
if (chat.bindToEnd && index + 1 === n) {
chat.positionViewAtEnd()
}
}
function sendMessage (text) {
textArea.text = ''
chat.bindToEnd = true
......
......@@ -65,7 +65,6 @@ Rectangle {
// more entries.
onEntryTypeFilterChanged: Logic.initView()
onMoreEntriesLoaded: Logic.handleMoreEntriesLoaded(n)
onDataChanged: Logic.handleDataChanged(topLeft, bottomRight)
}
// -----------------------------------------------------------------------
......@@ -209,4 +208,16 @@ Rectangle {
}
}
}
// ---------------------------------------------------------------------------
// Scroll at end if necessary.
// ---------------------------------------------------------------------------
Timer {
interval: 100
repeat: true
running: true
onTriggered: chat.bindToEnd && chat.positionViewAtEnd()
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment