For my ReactJS project I have a simple text list (using <ul>
and <li>
tags), which has it's own scroll bar to navigate through the list, but not the whole page. I was able to do this with this css code:
#List-container {
max-height: 425px;
overflow: hidden;
overflow-y: scroll;
}
For my project, I need it to automatically scroll down to the bottom of the list. I tried using window.scrollTo()
but it's not working, which I'm pretty sure is because of the fact that there is a secondary scroll bar.
Does anyone know how I could use window.ScrollTo()
, or know any alternatives?
Thanks in advance!