Scroll browser to your code snippet

Folks,

Do you have a scenario where a user clicks a button but the response comes down the screen and is not visible unless the user scrolls manually?

Then, you can use this very simple snippet to auto-scroll the browser to the place where the action is happening.

You can use it as a simple function call shown below.
The page_id, section_id are strings that you can use to identify the tab (if not tab, just use a page name or something that identifies the current displaying page) and the section of code (ID name is your choice again)

See the gist below. Also would recommend to check the other gists as well. Thanks!

focus_here(page_id, section_id)
...... <<<< your streamlit code where you output something >>>>....