The front end imitates the problems encountered in Wechat's chat.

two people are chatting. After the message of
An is sent, it will be displayed in the chat box of AMagi B.
I use the scrollTo () method to keep the scroll axes of both dialogs at the bottom after the message is sent.
but what if B is flipping through the chat record when A sends the message, and you don"t want the scroll axis of the B chat box to scroll to the bottom automatically?

May.28,2021
When the

scroll bar stops, record whether the current position is at the bottom, and then automatically scroll according to this state


B chat box scroll axis before automatically scrolling to the bottom, add a judgment to determine whether there is an upturn operation

Menu