Page resetting position to the top

Previously I’ve had a problem that when my app is going through different steps the text from the previous step didn’t disappear - Text not disappearing

The solution was to enclose my elements for each step using

def stage_container():
    parent = st.empty() # parent empty exists in all stages
    parent.empty() # transient empty exists just long enough to clear the screen
    time.sleep(.01)
    return parent.container() # actual container replaces transient empty

Now I have a step with multiple text areas that exceed the screen size and you have to scroll the page.
New issue I’m facing is that whenever I enter a text and want to switch to the next text area the page will reset its position to the top and the user will have to scroll it again each time for the out of screen text areas.

Are theses two issues (text not disappearing and page resetting its position) mutually exclusive and can’t be fixed both at the same time or there’s another workaround?

There are CSS hacks to control scroll position, but the recommended thing is probably to build a multipage application. A script run tries to preserve elements and scroll position, so making one page that sometimes preserves things and sometimes not does create extra hoops to jump through. Using a page change instead of a staging within one script would likely be the easiest solution, but the details of what would be ideal might come down to more specific details of what your app is doing.