Commit 2b4c17be authored by Ronan Abhamon's avatar Ronan Abhamon

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

parent 1472adcb
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
function initView () { function initView () {
chat.tryToLoadMoreEntries = false chat.tryToLoadMoreEntries = false
chat.bindToEnd = true chat.bindToEnd = true
chat.positionViewAtEnd()
} }
function loadMoreEntries () { function loadMoreEntries () {
...@@ -48,15 +47,6 @@ function handleMovementStarted () { ...@@ -48,15 +47,6 @@ function handleMovementStarted () {
chat.bindToEnd = false 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) { function sendMessage (text) {
textArea.text = '' textArea.text = ''
chat.bindToEnd = true chat.bindToEnd = true
......
...@@ -65,7 +65,6 @@ Rectangle { ...@@ -65,7 +65,6 @@ Rectangle {
// more entries. // more entries.
onEntryTypeFilterChanged: Logic.initView() onEntryTypeFilterChanged: Logic.initView()
onMoreEntriesLoaded: Logic.handleMoreEntriesLoaded(n) onMoreEntriesLoaded: Logic.handleMoreEntriesLoaded(n)
onDataChanged: Logic.handleDataChanged(topLeft, bottomRight)
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -209,4 +208,16 @@ Rectangle { ...@@ -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