Prevent page from automatically scrolling down


I recently deployed a multipage web app on the streamlit cloud and I donโ€™t know why but the app keeps scrolling down every time I access a new page, hiding the main navigation menu (added with streamlit-option-menu).

When opening it locally with streamlit run, I do not experience this behaviour. However, with the deployed version, it keeps scrolling down every time I navigate to a new page (before and after).

I got the same result on both chrome and brave, so I am not sure this is related the browser. I think the videos below will be more descriptive.

I would like to know if there is a way to prevent that behaviour, as it provides a pretty bad user experience.

Steps to reproduce

The code is spread across multiple files and hosted 
on a private GitHub repository so I can't really add it here.

Expected behavior:

When I open the app locally: video

Actual behavior:

What I get with the deployed version: video

Debug info

  • Streamlit version: 1.19.0
  • Streamlit-option-menu version: 0.3.2
  • Python version: 3.11.1
  • OS version: Windows 10

Hey @rimano,

Thanks for sharing your question.

Unfortunately, itโ€™s difficult for the community to figure out the root cause without seeing any code. Can you try to create a stripped-down version of your app that youโ€™re comfortable putting in a public GitHub repository?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.