I am importing an array of messages from a DB.
When i do
messages.addMessage(array) it inserts the messages, but it doesn’t scroll to the bottom.
If i add messages through the messagebar it does scroll down automatically.
There is no event listener to deal with changes to DOM elements, i think. Should i use MutationObserver and detect changes to the
I tried to add the following AFTER the addMessage():
But it doesn’t work, maybe the addMessage is asynchronous and when it tries to scroll there is nothing on the page yet.