Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost tabs remain if the tab contents take too long to compute #7040

Closed
3 of 4 tasks
mattminder opened this issue Jul 19, 2023 · 1 comment · Fixed by #7310
Closed
3 of 4 tasks

Ghost tabs remain if the tab contents take too long to compute #7040

mattminder opened this issue Jul 19, 2023 · 1 comment · Fixed by #7310
Assignees
Labels
feature:st.tabs priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@mattminder
Copy link

mattminder commented Jul 19, 2023

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

I have an application where the amount of tabs depends on some user choice. If the user goes from a choice with more tabs to a choice with less tabs, the old, superfluous tabs remain until the page has completely loaded. Since my page takes quite some time to load, this is confusing to users - especially since the area isn't greyed out and the rest of the content has already be properly loaded.

Reproducible Code Example

Open in Streamlit Cloud

import streamlit as st
import time

button = st.radio("How many tabs?", [5, 6])
tab_names = list(map(str, range(button)))


for tab in st.tabs(tab_names):
    with tab:
        st.header(f"you clicked button {button}")  

time.sleep(5)

Steps To Reproduce

No response

Expected Behavior

If the user goes from the choice that leads to more tabs to the choice with less tabs, one would expect the superfluous tabs to immediately disappear - not after the application has been loaded completely.

Current Behavior

After switching from the option with more tabs to the option with less tabs, only the new tabs are overwritten but the old tabs arent removed - not until the page has finished running.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.24
  • Python version: 3.10.9
  • Operating System: Windows 10, using WSL with Ubuntu 20.04 LTS
  • Browser: Firefox, Edge

Additional Information

No response

@mattminder mattminder added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Jul 19, 2023
@carolinedlu
Copy link
Collaborator

Thanks for flagging this, @mattminder! Potentially related: Invisible tabs #5454

@mayagbarnes mayagbarnes added status:confirmed Bug has been confirmed by the Streamlit team priority:P3 and removed status:needs-triage Has not been triaged by the Streamlit team labels Sep 7, 2023
@mayagbarnes mayagbarnes self-assigned this Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.tabs priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants