victoryhb / streamlit-option-menu

streamlit-option-menu is a simple Streamlit component that allows users to select a single item from a list of options in a menu.
MIT License
587 stars 69 forks source link

Visual bug if used with st.chat_input #54

Open Daniel-Fauland opened 10 months ago

Daniel-Fauland commented 10 months ago

If you use streamlit_option_menu and st.chat_input is used in one of the options there is a visual bug where you have to press the tab twice before you switch to the right page/tab.

import streamlit as st
from streamlit_option_menu import option_menu

selected2 = option_menu(None, ["Home", "Upload", "Tasks"], 
icons=['house', 'cloud-upload', "list-task", 'gear'], 
menu_icon="cast", default_index=0, orientation="horizontal")

if selected2 == "Home":
    if prompt := st.chat_input("Enter your text"):
        st.chat_message(prompt)
elif selected2 == "Upload":
    st.write("Upload")
elif selected2 == "Tasks":
    st.write("Tasks")
yanhong-zhao-ef commented 6 months ago

I can see that a PR is referenced here but the problem doesn't seem to be fixed

ishaan-mehta commented 4 months ago

Yes, this still appears to be an issue. @Joao-Alves @blipk @victoryhb @fgdvir are there any plans to fix this?

ishaan-mehta commented 1 month ago

This bug means that the core visual cues that one would expect from an option menu are nonexistent for any apps using a chat input — is there any idea how to fix this or any workarounds? I would love to keep using this package.

@victoryhb