question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

st.tabs() error with interactive widgets

See original GitHub issue

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

Open in Streamlit Cloud

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:

  1. Go to Tab-B or Tab-C
  2. 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:

https://user-images.githubusercontent.com/33048832/179844873-aaafc516-1430-43dc-b30d-aa81719f1d39.mov

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:14

github_iconTop GitHub Comments

1reaction
nathancooperjonescommented, Oct 17, 2022

I got the same issue too.

This seems related to Safari and session_state changes. When the very first interaction with button / checkbox takes place in tab other than the first one, the app jumps back to the first tab itself.

The issue occurs for me on Chrome as well as Safari, so I don’t think the issue is just related to Safari.

1reaction
JuhyeokSincommented, Jul 20, 2022

Unfortunately, I’m also not able to reproduce this. I have also deployed a version on Streamlit Cloud here. @JuhyeokSin is the issue also happening with the deployed app? There was also a forum post, which might be related to this issue. But I have no clue why and when this might happen…

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop switching tabs when I am adding in a new variable in tab
I have an app that dynamically adds/removes tabs (i.e. changes their set) based on a multiselect. There are a few problems: The tab...
Read more >
Validate that tabs are moved to a target dashboard
When you move a dashboard with an update set, validate that the tabs are moved to the target instance and are populated.
Read more >
Tabs Widget - jQuery UI API Documentation
For more information on widget extensions, see Extending Widgets with the Widget Factory. _getList()Returns: jQuery. Determine which list should be converted to ...
Read more >
UM1718 User manual - STM32CubeMX for STM32 ...
following documents are available on www.st.com: ... Configuration window tabs (GPIO, DMA and NVIC settings for STM32F4 Series) .
Read more >
ipywidgets Documentation - Read the Docs
from ipywidgets import interact, interactive, fixed ... You can close a widget by calling its close() method. ... tab = widgets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found