streamlit: st.tabs() error with interactive widgets
Summary
Assume that you have multiple (at least two) tabs. When you select something from a tab that is not the first one, it redirects you to the first tab. This only happens the very first time. Also, you see that any selection made is still there though.
Steps to reproduce
Code snippet:
import streamlit as st
tab_a, tab_b, tab_c = st.tabs(["Tab-A", "Tab-B", "Tab-C"])
with tab_a:
toggle_a = st.radio(label="toggle_a", options=["1a", "2a", "3a"], key="unique-a")
with tab_b:
toggle_b = st.radio(label="toggle_b", options=["1b", "2b", "3b"], key="unique-b")
with tab_c:
toggle_c = st.radio(label="toggle_c", options=["1c", "2c", "3c"], key="unique-c")
If applicable, please provide the steps we should take to reproduce the bug:
- Go to Tab-B or Tab-C
- Click on any radio button under Tab-B or Tab-C
Expected behavior: No UI changes when you select something from a widget in any of the tabs.
Actual behavior:
Is this a regression?
No
Debug info
- Streamlit version: 1.11.0
- Python version: 3.8.12
- Using Conda
- OS version: macOS Monterey V12.4 and python:3.8-slim-buster (Debian GNU/Linux 10)
- Browser version: Safari Version 15.5
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 19
The issue occurs for me on Chrome as well as Safari, so I don’t think the issue is just related to Safari.
Hi @LukasMasuch, I just noticed that I haven’t shared my answer to one of your questions. The issue is not happening with the deployed app that you shared with me.