streamlit / streamlit

Streamlit — A faster way to build and share data apps.
https://streamlit.io
Apache License 2.0
34.59k stars 3k forks source link

Weird behavior with tabs and st.slider #7017

Closed digitalghost-dev closed 1 year ago

digitalghost-dev commented 1 year ago

Checklist

Summary

I'm using st.tabs on my dashboard and using st.slider on one of the tabs. Whenever I use the slider on another tab other than the first tab, it will change tabes by itself. It also has weird visual issues. This issue goes away without using tabs.

Here's a .gif showing the behavior: https://storage.googleapis.com/website-storage-bucket/st_slider_bug.gif

Reproducible Code Example

No response

Steps To Reproduce

No response

Expected Behavior

No response

Current Behavior

No response

Is this a regression?

Debug info

Additional Information

No response

carolinedfrasca commented 1 year ago

Hey @digitalghost-dev,

Thank you for sharing this issue. I wasn't able to reproduce the behavior of the app switching tabs automatically, but I was able to see some weird visual issues. Could you share a code snippet so we can try to also reproduce the tab-switching behavior?

digitalghost-dev commented 1 year ago

@carolinedlu - I'm trying to trim down the code I have for my app so that I don't have to paste so much code at once but when I do, I can't see to reliably reproduce the issue. Sometimes the slider works without issues and after playing around with it, it'll switch the tab.

I'm also connecting to different data sources (BigQuery and PostgreSQL) so I might might have to fill in fake data as well.. would you want me to share the entire file contents? The current file that I have is reflecting the issue every time.

digitalghost-dev commented 1 year ago

@carolinedlu - same this is also happening with st.checkbox.

with tab4:
    st.checkbox("Expand Table for Full Width", value=True, key="sortable_dataframe")

    st.dataframe(
        standings_df, 
        hide_index=True, 
        use_container_width=st.session_state.sortable_dataframe)

Clicking the checkmark reloads the page and brings me back to tab1. I can create a .gif for this if you would like to see a video. If you want to me to build my app minus the data connections and fill in fake data, I can work on that as well.

jrieke commented 1 year ago

Potentially related: #4996, #6257

digitalghost-dev commented 1 year ago

@jrieke yes, those look similar to my issue!

digitalghost-dev commented 1 year ago

Updating just to say that this is also happening with st.selectbox and st.radio.

mayagbarnes commented 1 year ago

Closing as duplicate of https://github.com/streamlit/streamlit/issues/6257