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

Invisible tabs #5454

Closed
samuelefiorini opened this issue Sep 30, 2022 · 1 comment · Fixed by #7287
Closed

Invisible tabs #5454

samuelefiorini opened this issue Sep 30, 2022 · 1 comment · Fixed by #7287
Assignees
Labels
feature:st.tabs priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@samuelefiorini
Copy link

samuelefiorini commented Sep 30, 2022

Summary

Unexpected tab behavior when their creation depends on some condition (e.g.: a checkbox).

Steps to reproduce

Open in Streamlit Cloud

import streamlit as st

checkboxes = {k: st.checkbox(f"Checkbox {k}", value=True) for k in range(3)}

tabs = st.tabs([f"Tab {k}" for k, v in checkboxes.items() if v])

for tab, text in zip(tabs, checkboxes):
    with tab:
        st.write(f"Text {text}")

Steps to reproduce:

  1. Switch to Tab 2
  2. Click on Checkbox 1 (uncheck)

Expected behavior:

Move page focus to the left, to keep it on Tab 2.

Actual behavior:

Page focus is on some invisible tab on the right (see image below).

Debug info

  • Streamlit version: 1.13.1
  • Python version: 3.9.10
  • Using Conda
  • OS version: Windows 10
  • Browser version: Chrome Version 105.0.5195.127 (Official Build) (64-bit)

Additional information

bug-tab

@samuelefiorini samuelefiorini added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Sep 30, 2022
@LukasMasuch LukasMasuch added the status:confirmed Bug has been confirmed by the Streamlit team label Oct 11, 2022
@LukasMasuch
Copy link
Collaborator

LukasMasuch commented Oct 11, 2022

@samuelefiorini Thanks for reporting this issue. I was able to reproduce the issue here. This definitely requires a fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.tabs priority:P2 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.

3 participants