I
I
Igor2021-08-27 14:19:21
React
Igor, 2021-08-27 14:19:21

Scrolling to the bottom of the chat when loading, like in VK?

Good afternoon.

Need help with the chat, the essence of the task, when you click on the chat, scroll the div to the very bottom to the last message

Just scrolling is not a problem on js, like container.scrollTop = container.scrollHeight
The problem is when images start to load, the scroll occurs before loading, and then the block is shifted up

You can hang onload on images, but then the scroll twitches

I am looking for a css solution, I found it with position absolute ( here ), but it does not work correctly, it is displayed from the bottom up, but the ability to scroll disappears

Any information will be useful how large companies make chats on react

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question