Open page already scrolled at bottom (chat app)


#22

So here is what i did regarding the content automatically scrolls down to bottom when you scroll up.

If you log your scrollToBottom function, you could see that the scrollToBottom function exectues several times on page load and even if you stay idle, it will continue to execute, i suspect it has something to do with two-way binding.

So what i did is this:

scroll = true;
scrollToBottom() {
    if(this.scroll) {
        this.content.scrollToBottom(0);
        this.scroll = false;
    }
}

and it will execute once after page load, what if you want it to automatically scroll again? just set scroll = true again whenever you need it.


#24

Paulo Vitor, este seu chat é código aberto? Quero desenvolver algo parecido.


#25

@DanielRP will reply directly to you


#26

How do i add timestamps inside bubbles?