Auto-scrolling does not work. How to fix it?

Our chat is designed to auto-scroll messages when a new message is posted. This way any new message becomes immediately visible for chatters. However, you may want to read past messages without being auto-scrolled down. We solved it this way: when you scroll up to see past messages the auto-scrolling feature becomes disabled. You can re-enable it by scrolling messages down to the latest one. Understanding this is crucial. You may get a wrong impression of a broken auto-scrolling, but when the scrollbar is even a little bit up the auto-scroll will not work.