# St.navigation behavior

**URL:** <https://discuss.streamlit.io/t/st-navigation-behavior/74396>\
**Category:** Using Streamlit\
**Tags:** navigation, discussion\
**Created:** [July 8, 2024, 6:14pm UTC](https://discuss.streamlit.io/t/st-navigation-behavior/74396 "2024-07-08T18:14:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Libbers](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/libbers/32/42298_2.png) [@Libbers](https://discuss.streamlit.io/u/Libbers)\
**Post date:** [July 8, 2024, 6:14pm UTC](https://discuss.streamlit.io/t/st-navigation-behavior/74396/1 "2024-07-08T18:14:43Z")

</div>

If you’re creating a **debugging post** , please include the following info:

1. Are you running your app locally or is it deployed? YES
2. If your app is deployed:  
a. Is it deployed on Community Cloud or another hosting platform? NO  
b. Share the link to the public deployed app.
3. Share the link to your app’s public GitHub repository (including a [requirements file](https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app/app-dependencies)).
4. Share the full text of the error message (not a screenshot). N/A
5. Share the Streamlit and Python versions.

```auto
import streamlit as st
st.logo("Banner-GPT-generated.webp")
pages = {
    "Core Features" : [
        st.Page("pgtest_1.py",title="Page 1 Test",icon=":material/settings:"),
        st.Page("pgtest_2.py",title="Page 2 Test",icon=":material/home:")],
    "Admin Features" : [
        st.Page("pages/pgtest_3.py",title="Page 3 Test",icon=":material/public:"),
        st.Page("pages/pgtest_4.py",title="Page 4 Test",icon=":material/menu:")]
}

app = st.navigation(pages)
app.run()

'This content is on nav_main'

```

all of the pgtest\_#.py files are the same:

```auto
from streamlit import write as w
w("this is Page 2")

```

I’m just testing st.navigation and I’m seeing unexpected behavior:

1. If I navigate to page, 2,3 or 4 and click the browser refresh it hangs. I tried on Brave and Edge with same results. I can break the hang by changing the URL to [http://localhost:8501](http://localhost:8501)
2. ’ This content is on nav\_main’ shows up on every page, is this by design?
3. I have a different icon for each page, and when I click on a page from navigation, the icon on my browser tab changes to the icon on the corresponding st.page. Is there a way to over-ride this behavior so that the browser icon remains constant?

---

<div class="post-metadata">

**Author:** ![padmanabhareddy82](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@padmanabhareddy82](https://discuss.streamlit.io/u/padmanabhareddy82)\
**Post date:** [July 8, 2024, 7:53pm UTC](https://discuss.streamlit.io/t/st-navigation-behavior/74396/2 "2024-07-08T19:53:25Z")

</div>

Did you figure out the solution for first unexpected behavior am also getting the same error.

---

<div class="post-metadata">

**Author:** ![Dragos](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/dragos/32/45712_2.png) [@Dragos](https://discuss.streamlit.io/u/Dragos)\
**Post date:** [July 8, 2024, 8:17pm UTC](https://discuss.streamlit.io/t/st-navigation-behavior/74396/3 "2024-07-08T20:17:41Z")

</div>

I tried the example from [st.navigation docs](https://docs.streamlit.io/develop/api-reference/navigation/st.navigation) and I’m getting the same issue.

Also, no luck using the /pages method. I created 2 files with a simple st.write in them and a main .py with a st.write too. URL/page2 just shows an endless load.

I’m using a plain env of python 3.12.3, with streamlit 1.36.  
With 1.35, this doesn’t happen (at least the /pages approach).

EDIT:

This is known issues and it may be fixed in the nightly build.

> <https://github.com/streamlit/streamlit/issues/8958>
>
> \### Checklist
> 
> \- \[X\] I have searched the \[existing issues\](https://github.com/…streamlit/streamlit/issues) for similar issues.
> \- \[X\] I added a very descriptive title to this issue.
> \- \[X\] I have provided sufficient information below to help reproduce this issue.
> 
> \### Summary
> 
> Select the basketball page and press reload page button (google chrome browser), generates web socket connection error continuously.
> 
> I believe this is a serious bug and deserves a higher priority. We cannot prevent users from pressing that reload button.
> 
> !\[image\](https://github.com/streamlit/streamlit/assets/22366935/07d0358e-102c-419d-844d-04236732a31d)
> 
> !\[image\](https://github.com/streamlit/streamlit/assets/22366935/78ba2c72-e6de-4546-9ee5-02d23383309f)
> 
> 
> \### Reproducible Code Example
> 
> \`\`\`Python
> """
> streamlit==1.36.0
> """
> 
> 
> import streamlit as st
> 
> 
> def Home():
> st.header('Home')
> 
> 
> def Basketball():
> st.header('Basketball')
> 
> 
> pg = st.navigation(
> \[
> st.Page(Home),
> st.Page(Basketball)
> \]
> )
> pg.run()
> \`\`\`
> 
> 
> \### Steps To Reproduce
> 
> Run the code, select basketball page and press the reload button of the browser.
> 
> \### Expected Behavior
> 
> \_No response\_
> 
> \### Current Behavior
> 
> \_No response\_
> 
> \### Is this a regression?
> 
> \- \[\] Yes, this used to work in a previous version.
> 
> \### Debug info
> 
> \- Streamlit version: 1.36.0
> \- Python version: 3.11.7
> \- Operating System: Windows 10
> \- Browser: Google chrome
> 
> 
> \### Additional Information
> 
> https://discuss.streamlit.io/t/launched-multi-page-apps-improved-api-and-new-navigation-ui-features/65679/31

> <https://github.com/streamlit/streamlit/issues/8986>
>
> \### Checklist
> 
> \- \[X\] I have searched the \[existing issues\](https://github.com/st…reamlit/streamlit/issues) for similar issues.
> \- \[X\] I added a very descriptive title to this issue.
> \- \[X\] I have provided sufficient information below to help reproduce this issue.
> 
> \### Summary
> 
> When creating multiple pages using st.navigation(), the page is not reloading properly using reload button in google chrome.
> 
> !\[image\](https://github.com/streamlit/streamlit/assets/45418179/1f7a88fc-1567-404f-a33c-34f846378cd8)
> 
> I have to go back to the home page, click refresh (chrome), then go to the selected page
> 
> 
> 
> \### Reproducible Code Example
> 
> \`\`\`Python
> \##### Home.py page
> import streamlit as st
> 
> pages = {
> "First Section" : \[
> st.Page("sections/Page1.py", title="Create your account")
> \],
> "Second Section" : \[
> st.Page("sections/Page2.py", title="Learn about us")
> \]
> }
> 
> pg = st.navigation(pages)
> 
> pg.run()
> 
> \###################################################
> \# sections/section1/Page.py page
> import streamlit as st
> st.header('Page 1')
> 
> \########################################################
> 
> \# sections/section2/Page.py page
> import streamlit as st
> st.header('Page 2')
> \`\`\`
> 
> 
> \### Steps To Reproduce
> 
> 1. Create the Home.py page from the code in the Reproducible Code Example
> 2. Create directory sections
> 3. Create directories sections/section1/ and sections/section2/
> 4. Create Page1 in section1 from the code in the Reproducible Code Example
> 5. Create Page2 in section2 from the code in the Reproducible Code Example
> 6. Run the application streamlit run Home.py
> 7. Go to Page2 
> 8. Click Reload 
> 
> \### Expected Behavior
> 
> Page to reload the same way as using pages/ directory
> 
> \### Current Behavior
> 
> \_No response\_
> 
> \### Is this a regression?
> 
> \- \[\] Yes, this used to work in a previous version.
> 
> \### Debug info
> 
> \- Streamlit version: 1.36.0
> \- Python version: 3.11.9
> \- Operating System: Widows
> \- Browser: google chrome
> 
> 
> \### Additional Information
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [January 4, 2025, 8:17pm UTC](https://discuss.streamlit.io/t/st-navigation-behavior/74396/4 "2025-01-04T20:17:53Z")

</div>

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